Changeset 2911544
- Timestamp:
- 05/12/2023 09:44:55 AM (3 years ago)
- Location:
- exmage-wp-image-links/trunk
- Files:
-
- 3 edited
-
CHANGELOG.txt (modified) (1 diff)
-
exmage-wp-image-links.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
exmage-wp-image-links/trunk/CHANGELOG.txt
r2846469 r2911544 1 /**1.0.15 - 2023.05.12**/ 2 - Updated: Keep exmage link of product when import product from csv 3 1 4 /**1.0.14 - 2023.01.11**/ 2 5 - Updated: If the number of images is greater than threshold(20 by default, able to change via exmage_ajax_handle_url_threshold hook), they will be processed in the background -
exmage-wp-image-links/trunk/exmage-wp-image-links.php
r2846469 r2911544 4 4 * Plugin URI: https://villatheme.com/extensions/exmage-wordpress-image-links/ 5 5 * Description: Save storage by using external image URLs. 6 * Version: 1.0.1 46 * Version: 1.0.15 7 7 * Author: VillaTheme(villatheme.com) 8 8 * Author URI: https://villatheme.com 9 9 * Text Domain: exmage-wp-image-links 10 * Copyright 2021-202 2VillaTheme.com. All rights reserved.11 * Tested up to: 6. 110 * Copyright 2021-2023 VillaTheme.com. All rights reserved. 11 * Tested up to: 6.2 12 12 * Requires PHP: 7.0 13 13 **/ … … 16 16 } 17 17 18 define( 'EXMAGE_WP_IMAGE_LINKS_VERSION', '1.0.1 4' );18 define( 'EXMAGE_WP_IMAGE_LINKS_VERSION', '1.0.15' ); 19 19 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 20 20 define( 'EXMAGE_WP_IMAGE_LINKS_DIR', plugin_dir_path( __FILE__ ) ); … … 65 65 'wpml_after_duplicate_attachment' 66 66 ), 10, 2 ); 67 68 add_action( 'woocommerce_product_import_before_process_item', function () { 69 remove_action( 'pre_get_posts', [ $this, 'search_exmage_url_when_import_product' ] ); 70 add_action( 'pre_get_posts', [ $this, 'search_exmage_url_when_import_product' ] ); 71 } ); 72 73 add_action( 'woocommerce_product_import_inserted_product_object', function () { 74 remove_action( 'pre_get_posts', [ $this, 'search_exmage_url_when_import_product' ] ); 75 } ); 67 76 } 68 77 … … 664 673 ); 665 674 if ( class_exists( 'WPML_Media_Attachments_Duplication' ) ) { 666 /*Prevent WPML from duplicating this external image*/675 /*Prevent WPML from duplicating this external image*/ 667 676 exmage_remove_filter( 'add_attachment', 'WPML_Media_Attachments_Duplication', 'save_attachment_actions' ); 668 677 exmage_remove_filter( 'add_attachment', 'WPML_Media_Attachments_Duplication', 'save_translated_attachments' ); … … 987 996 ) ); 988 997 } 998 999 public function search_exmage_url_when_import_product( &$q ) { 1000 if ( ! empty( $q->query_vars['meta_query'] ) ) { 1001 $file = ''; 1002 foreach ( $q->query_vars['meta_query'] as $key => &$mt_qr ) { 1003 if ( ! empty( $mt_qr['key'] ) && $mt_qr['key'] == '_wc_attachment_source' ) { 1004 $file = $mt_qr['value']; 1005 break; 1006 } 1007 } 1008 if ( $file ) { 1009 $q->query_vars['meta_query'][] = [ 1010 'key' => '_exmage_external_url', 1011 'value' => $file, 1012 'compare' => 'LIKE', 1013 ]; 1014 1015 $q->query_vars['meta_query']['relation'] = 'OR'; 1016 } 1017 } 1018 1019 } 989 1020 } 990 1021 } -
exmage-wp-image-links/trunk/readme.txt
r2887265 r2911544 58 58 ### MAY BE YOU NEED 59 59 60 [SUBRE – Product Subscription for WooCommerce](https://bit.ly/subre-product-subscription-for-woo): Convert WooCommerce simple products(physical or downloadable/virtual) to subscription products and allow recurring payments 61 60 62 [Clear Autoptimize Cache Automatically](https://bit.ly/clear-autoptimize-cache-automatically): Clear Autoptimize cache automatically by cache amount or by time interval 61 63 … … 158 160 159 161 == Changelog == 162 163 /**1.0.15 - 2023.05.12**/ 164 - Updated: Keep exmage link of product when import product from csv 165 160 166 /**1.0.14 - 2023.01.11**/ 161 167 - Updated: If the number of images is greater than threshold(20 by default, able to change via exmage_ajax_handle_url_threshold hook), they will be processed in the background
Note: See TracChangeset
for help on using the changeset viewer.