Changeset 3804970
- Timestamp:
- 11/16/2026 11:28:48 AM (10 days ago)
- Location:
- loop-grid-extender-for-elementor-pro
- Files:
-
- 2 added
- 10 edited
- 1 copied
-
tags/1.2.2 (copied) (copied from loop-grid-extender-for-elementor-pro/trunk )
-
tags/1.2.2/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tag-manager.php (modified) (1 diff)
-
tags/1.2.2/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tags/AcfRepeaterImageTag.php (modified) (1 diff)
-
tags/1.2.2/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tags/AcfRepeaterImageUrlTag.php (added)
-
tags/1.2.2/includes/class-register-dynamic-acf-repeater-tag.php (modified) (1 diff)
-
tags/1.2.2/loop-grid-extender-for-elementor-pro.php (modified) (2 diffs)
-
tags/1.2.2/readme.txt (modified) (2 diffs)
-
trunk/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tag-manager.php (modified) (1 diff)
-
trunk/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tags/AcfRepeaterImageTag.php (modified) (1 diff)
-
trunk/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tags/AcfRepeaterImageUrlTag.php (added)
-
trunk/includes/class-register-dynamic-acf-repeater-tag.php (modified) (1 diff)
-
trunk/loop-grid-extender-for-elementor-pro.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
loop-grid-extender-for-elementor-pro/tags/1.2.2/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tag-manager.php
r3759887 r3804970 28 28 29 29 public static function get_tag_classes_names() { 30 $available_tags = ['AcfRepeaterImageTag', 'AcfRepeaterDateTag', 'AcfRepeaterPostTitleTag', 'AcfRepeaterTextTag', 'AcfRepeaterUrlTag', 'AcfRepeaterEmailTag', 'AcfRepeaterEmailUrlTag', 'AcfRepeaterNumberTag', 'AcfRepeaterWysiwygTag'];30 $available_tags = ['AcfRepeaterImageTag', 'AcfRepeaterImageUrlTag', 'AcfRepeaterDateTag', 'AcfRepeaterPostTitleTag', 'AcfRepeaterTextTag', 'AcfRepeaterUrlTag', 'AcfRepeaterEmailTag', 'AcfRepeaterEmailUrlTag', 'AcfRepeaterNumberTag', 'AcfRepeaterWysiwygTag']; 31 31 return $available_tags; 32 32 } -
loop-grid-extender-for-elementor-pro/tags/1.2.2/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tags/AcfRepeaterImageTag.php
r3352417 r3804970 20 20 } 21 21 22 /** 23 * Image controls only: this tag returns an image array (id and url). 24 * Link (URL) controls use AcfRepeaterImageUrlTag, listed there with the same title. 25 * 26 * @return string[] 27 */ 22 28 public function get_categories() { 23 29 return [ 24 30 \Elementor\Modules\DynamicTags\Module::IMAGE_CATEGORY, 25 \Elementor\Modules\DynamicTags\Module::URL_CATEGORY,26 31 ]; 27 32 } -
loop-grid-extender-for-elementor-pro/tags/1.2.2/includes/class-register-dynamic-acf-repeater-tag.php
r3352417 r3804970 11 11 public function __construct(){ 12 12 add_action( 'elementor/dynamic_tags/register', [$this, 'lgefep_register_acf_repeater_dynamic_tags'] ); 13 13 add_filter( 'elementor/document/load/data', array( $this, 'lgefep_migrate_legacy_image_link_tags_in_data' ), 10, 2 ); 14 // Priority 1: run before other before_render callbacks (such as Elementor Pro display conditions) read and cache the settings. 15 add_action( 'elementor/frontend/before_render', array( $this, 'lgefep_migrate_legacy_image_link_tags' ), 1, 1 ); 16 add_action( 'elementor/widget/before_render_content', array( $this, 'lgefep_migrate_legacy_image_link_tags' ), 1, 1 ); 17 // The CSS pass parses dynamic tags of all controls, so a legacy tag left in a link control would raise an "Array to string conversion" warning. 18 add_action( 'elementor/element/before_parse_css', array( $this, 'lgefep_migrate_legacy_image_link_tags_for_css' ), 10, 2 ); 14 19 } 20 21 /** 22 * Link (URL) controls saved with "ACF Repeater Image" (acf-repeater-image) got the image array, which Elementor 23 * prints as "Array". Link controls now use acf-repeater-image-url, listed with the same title, so switch those 24 * saved links when a document is loaded (editor, so the editor shows and saves the new tag). 25 * 26 * @param array $data Elements data. 27 * @param \Elementor\Core\Base\Document $document Document being loaded. 28 * @return array 29 */ 30 public function lgefep_migrate_legacy_image_link_tags_in_data( $data, $document = null ) { 31 unset( $document ); 32 33 if ( ! is_array( $data ) ) { 34 return $data; 35 } 36 37 return $this->lgefep_migrate_elements_data( $data ); 38 } 39 40 /** 41 * Same switch for each element before it is rendered (front end, cached elements and editor preview), 42 * because front end rendering reads the saved data without the load filter. 43 * 44 * @param \Elementor\Element_Base $element The element about to be rendered. 45 * @return void 46 */ 47 public function lgefep_migrate_legacy_image_link_tags( $element ) { 48 if ( ! $element instanceof \Elementor\Controls_Stack ) { 49 return; 50 } 51 52 $settings = $element->get_settings(); 53 $controls = $element->get_controls(); 54 55 if ( ! is_array( $settings ) || ! is_array( $controls ) ) { 56 return; 57 } 58 59 $migrated = $this->lgefep_migrate_settings( $settings, $controls ); 60 61 foreach ( $migrated as $key => $value ) { 62 if ( ! array_key_exists( $key, $settings ) || $settings[ $key ] !== $value ) { 63 $element->set_settings( $key, $value ); 64 } 65 } 66 } 67 68 /** 69 * Same switch for the CSS pass, which parses the element settings before it is rendered. 70 * 71 * @param \Elementor\Core\Files\CSS\Post $css_file The CSS file being generated. 72 * @param \Elementor\Element_Base $element The element whose CSS is generated. 73 * @return void 74 */ 75 public function lgefep_migrate_legacy_image_link_tags_for_css( $css_file, $element ) { 76 unset( $css_file ); 77 $this->lgefep_migrate_legacy_image_link_tags( $element ); 78 } 79 80 /** 81 * Walk elements data (and their child elements) and switch the legacy link tags. 82 * 83 * @param array $elements Elements data. 84 * @return array 85 */ 86 private function lgefep_migrate_elements_data( array $elements ) { 87 foreach ( $elements as $index => $element ) { 88 if ( ! is_array( $element ) ) { 89 continue; 90 } 91 92 if ( ! empty( $element['settings'] ) && is_array( $element['settings'] ) ) { 93 $controls = $this->lgefep_get_element_controls( $element ); 94 95 if ( $controls ) { 96 $elements[ $index ]['settings'] = $this->lgefep_migrate_settings( $element['settings'], $controls ); 97 } 98 } 99 100 if ( ! empty( $element['elements'] ) && is_array( $element['elements'] ) ) { 101 $elements[ $index ]['elements'] = $this->lgefep_migrate_elements_data( $element['elements'] ); 102 } 103 } 104 105 return $elements; 106 } 107 108 /** 109 * Controls of an element or widget type from its data. 110 * 111 * @param array $element Element data. 112 * @return array 113 */ 114 private function lgefep_get_element_controls( array $element ) { 115 $plugin = \Elementor\Plugin::$instance; 116 $type = null; 117 118 if ( isset( $element['elType'] ) && 'widget' === $element['elType'] ) { 119 if ( ! empty( $element['widgetType'] ) && is_string( $element['widgetType'] ) ) { 120 $type = $plugin->widgets_manager->get_widget_types( $element['widgetType'] ); 121 } 122 } elseif ( ! empty( $element['elType'] ) && is_string( $element['elType'] ) ) { 123 $type = $plugin->elements_manager->get_element_types( $element['elType'] ); 124 } 125 126 if ( ! $type instanceof \Elementor\Controls_Stack ) { 127 return array(); 128 } 129 130 $controls = $type->get_controls(); 131 132 return is_array( $controls ) ? $controls : array(); 133 } 134 135 /** 136 * Switch the legacy link tags in element settings: the element dynamic tags and the dynamic tags 137 * of each repeater item (for example Icon List items). 138 * 139 * @param array $settings Element settings. 140 * @param array $controls Element controls. 141 * @return array 142 */ 143 private function lgefep_migrate_settings( array $settings, array $controls ) { 144 if ( ! empty( $settings['__dynamic__'] ) && is_array( $settings['__dynamic__'] ) ) { 145 $settings['__dynamic__'] = $this->lgefep_switch_image_link_tags( $settings['__dynamic__'], $controls ); 146 } 147 148 foreach ( $controls as $control_name => $control ) { 149 if ( empty( $control['type'] ) || \Elementor\Controls_Manager::REPEATER !== $control['type'] || empty( $control['fields'] ) || empty( $settings[ $control_name ] ) || ! is_array( $settings[ $control_name ] ) ) { 150 continue; 151 } 152 153 foreach ( $settings[ $control_name ] as $index => $item ) { 154 if ( is_array( $item ) && ! empty( $item['__dynamic__'] ) && is_array( $item['__dynamic__'] ) ) { 155 $settings[ $control_name ][ $index ]['__dynamic__'] = $this->lgefep_switch_image_link_tags( $item['__dynamic__'], $control['fields'] ); 156 } 157 } 158 } 159 160 return $settings; 161 } 162 163 /** 164 * Switch acf-repeater-image tags used in URL controls to acf-repeater-image-url. 165 * 166 * @param array $dynamic Dynamic tags keyed by control name. 167 * @param array $controls Controls (or repeater fields). 168 * @return array 169 */ 170 private function lgefep_switch_image_link_tags( array $dynamic, array $controls ) { 171 foreach ( $dynamic as $control_name => $tag_text ) { 172 if ( ! is_string( $tag_text ) || false === strpos( $tag_text, 'name="acf-repeater-image"' ) ) { 173 continue; 174 } 175 176 $type = ''; 177 178 foreach ( $controls as $key => $control ) { 179 $name = isset( $control['name'] ) ? $control['name'] : $key; 180 181 if ( $name === $control_name ) { 182 $type = isset( $control['type'] ) ? $control['type'] : ''; 183 break; 184 } 185 } 186 187 if ( \Elementor\Controls_Manager::URL === $type ) { 188 $dynamic[ $control_name ] = str_replace( 'name="acf-repeater-image"', 'name="acf-repeater-image-url"', $tag_text ); 189 } 190 } 191 192 return $dynamic; 193 } 15 194 16 195 public function lgefep_register_acf_repeater_dynamic_tags($dynamic_tags){ -
loop-grid-extender-for-elementor-pro/tags/1.2.2/loop-grid-extender-for-elementor-pro.php
r3759887 r3804970 3 3 * Plugin Name: Loop Grid Extender for Elementor - ACF Repeater & Smart Filters 4 4 * Description: Use ACF repeater fields inside Elementor loop items and add smart dynamic dropdown taxonomy filters to the Elementor Loop Grid widget. 5 * Version: 1.2. 15 * Version: 1.2.2 6 6 * Requires at least: 6.5 7 7 * Requires PHP: 7.4 … … 19 19 } 20 20 21 !defined('LGEFEP_VERSION') && define('LGEFEP_VERSION', '1.2. 1');21 !defined('LGEFEP_VERSION') && define('LGEFEP_VERSION', '1.2.2'); 22 22 !defined('LGEFEP_FILE') && define('LGEFEP_FILE', __FILE__); 23 23 !defined('LGEFEP_PLUGIN_DIR') && define('LGEFEP_PLUGIN_DIR', plugin_dir_path(LGEFEP_FILE)); -
loop-grid-extender-for-elementor-pro/tags/1.2.2/readme.txt
r3759887 r3804970 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 == Changelog == 136 136 137 = Version 1.2.2 | 16/11/2026 = 138 * **Fixed:** ACF Repeater Image dynamic tag outputting http://Array in link/URL fields. 139 137 140 = Version 1.2.1 | 22/10/2026 = 138 141 * **Fixed:** Elementor display conditions not working with ACF repeater field values in Loop Grid. -
loop-grid-extender-for-elementor-pro/trunk/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tag-manager.php
r3759887 r3804970 28 28 29 29 public static function get_tag_classes_names() { 30 $available_tags = ['AcfRepeaterImageTag', 'AcfRepeaterDateTag', 'AcfRepeaterPostTitleTag', 'AcfRepeaterTextTag', 'AcfRepeaterUrlTag', 'AcfRepeaterEmailTag', 'AcfRepeaterEmailUrlTag', 'AcfRepeaterNumberTag', 'AcfRepeaterWysiwygTag'];30 $available_tags = ['AcfRepeaterImageTag', 'AcfRepeaterImageUrlTag', 'AcfRepeaterDateTag', 'AcfRepeaterPostTitleTag', 'AcfRepeaterTextTag', 'AcfRepeaterUrlTag', 'AcfRepeaterEmailTag', 'AcfRepeaterEmailUrlTag', 'AcfRepeaterNumberTag', 'AcfRepeaterWysiwygTag']; 31 31 return $available_tags; 32 32 } -
loop-grid-extender-for-elementor-pro/trunk/includes/acf-repeater-dynamic-tag-controller/acf-repeater-tags/AcfRepeaterImageTag.php
r3352417 r3804970 20 20 } 21 21 22 /** 23 * Image controls only: this tag returns an image array (id and url). 24 * Link (URL) controls use AcfRepeaterImageUrlTag, listed there with the same title. 25 * 26 * @return string[] 27 */ 22 28 public function get_categories() { 23 29 return [ 24 30 \Elementor\Modules\DynamicTags\Module::IMAGE_CATEGORY, 25 \Elementor\Modules\DynamicTags\Module::URL_CATEGORY,26 31 ]; 27 32 } -
loop-grid-extender-for-elementor-pro/trunk/includes/class-register-dynamic-acf-repeater-tag.php
r3352417 r3804970 11 11 public function __construct(){ 12 12 add_action( 'elementor/dynamic_tags/register', [$this, 'lgefep_register_acf_repeater_dynamic_tags'] ); 13 13 add_filter( 'elementor/document/load/data', array( $this, 'lgefep_migrate_legacy_image_link_tags_in_data' ), 10, 2 ); 14 // Priority 1: run before other before_render callbacks (such as Elementor Pro display conditions) read and cache the settings. 15 add_action( 'elementor/frontend/before_render', array( $this, 'lgefep_migrate_legacy_image_link_tags' ), 1, 1 ); 16 add_action( 'elementor/widget/before_render_content', array( $this, 'lgefep_migrate_legacy_image_link_tags' ), 1, 1 ); 17 // The CSS pass parses dynamic tags of all controls, so a legacy tag left in a link control would raise an "Array to string conversion" warning. 18 add_action( 'elementor/element/before_parse_css', array( $this, 'lgefep_migrate_legacy_image_link_tags_for_css' ), 10, 2 ); 14 19 } 20 21 /** 22 * Link (URL) controls saved with "ACF Repeater Image" (acf-repeater-image) got the image array, which Elementor 23 * prints as "Array". Link controls now use acf-repeater-image-url, listed with the same title, so switch those 24 * saved links when a document is loaded (editor, so the editor shows and saves the new tag). 25 * 26 * @param array $data Elements data. 27 * @param \Elementor\Core\Base\Document $document Document being loaded. 28 * @return array 29 */ 30 public function lgefep_migrate_legacy_image_link_tags_in_data( $data, $document = null ) { 31 unset( $document ); 32 33 if ( ! is_array( $data ) ) { 34 return $data; 35 } 36 37 return $this->lgefep_migrate_elements_data( $data ); 38 } 39 40 /** 41 * Same switch for each element before it is rendered (front end, cached elements and editor preview), 42 * because front end rendering reads the saved data without the load filter. 43 * 44 * @param \Elementor\Element_Base $element The element about to be rendered. 45 * @return void 46 */ 47 public function lgefep_migrate_legacy_image_link_tags( $element ) { 48 if ( ! $element instanceof \Elementor\Controls_Stack ) { 49 return; 50 } 51 52 $settings = $element->get_settings(); 53 $controls = $element->get_controls(); 54 55 if ( ! is_array( $settings ) || ! is_array( $controls ) ) { 56 return; 57 } 58 59 $migrated = $this->lgefep_migrate_settings( $settings, $controls ); 60 61 foreach ( $migrated as $key => $value ) { 62 if ( ! array_key_exists( $key, $settings ) || $settings[ $key ] !== $value ) { 63 $element->set_settings( $key, $value ); 64 } 65 } 66 } 67 68 /** 69 * Same switch for the CSS pass, which parses the element settings before it is rendered. 70 * 71 * @param \Elementor\Core\Files\CSS\Post $css_file The CSS file being generated. 72 * @param \Elementor\Element_Base $element The element whose CSS is generated. 73 * @return void 74 */ 75 public function lgefep_migrate_legacy_image_link_tags_for_css( $css_file, $element ) { 76 unset( $css_file ); 77 $this->lgefep_migrate_legacy_image_link_tags( $element ); 78 } 79 80 /** 81 * Walk elements data (and their child elements) and switch the legacy link tags. 82 * 83 * @param array $elements Elements data. 84 * @return array 85 */ 86 private function lgefep_migrate_elements_data( array $elements ) { 87 foreach ( $elements as $index => $element ) { 88 if ( ! is_array( $element ) ) { 89 continue; 90 } 91 92 if ( ! empty( $element['settings'] ) && is_array( $element['settings'] ) ) { 93 $controls = $this->lgefep_get_element_controls( $element ); 94 95 if ( $controls ) { 96 $elements[ $index ]['settings'] = $this->lgefep_migrate_settings( $element['settings'], $controls ); 97 } 98 } 99 100 if ( ! empty( $element['elements'] ) && is_array( $element['elements'] ) ) { 101 $elements[ $index ]['elements'] = $this->lgefep_migrate_elements_data( $element['elements'] ); 102 } 103 } 104 105 return $elements; 106 } 107 108 /** 109 * Controls of an element or widget type from its data. 110 * 111 * @param array $element Element data. 112 * @return array 113 */ 114 private function lgefep_get_element_controls( array $element ) { 115 $plugin = \Elementor\Plugin::$instance; 116 $type = null; 117 118 if ( isset( $element['elType'] ) && 'widget' === $element['elType'] ) { 119 if ( ! empty( $element['widgetType'] ) && is_string( $element['widgetType'] ) ) { 120 $type = $plugin->widgets_manager->get_widget_types( $element['widgetType'] ); 121 } 122 } elseif ( ! empty( $element['elType'] ) && is_string( $element['elType'] ) ) { 123 $type = $plugin->elements_manager->get_element_types( $element['elType'] ); 124 } 125 126 if ( ! $type instanceof \Elementor\Controls_Stack ) { 127 return array(); 128 } 129 130 $controls = $type->get_controls(); 131 132 return is_array( $controls ) ? $controls : array(); 133 } 134 135 /** 136 * Switch the legacy link tags in element settings: the element dynamic tags and the dynamic tags 137 * of each repeater item (for example Icon List items). 138 * 139 * @param array $settings Element settings. 140 * @param array $controls Element controls. 141 * @return array 142 */ 143 private function lgefep_migrate_settings( array $settings, array $controls ) { 144 if ( ! empty( $settings['__dynamic__'] ) && is_array( $settings['__dynamic__'] ) ) { 145 $settings['__dynamic__'] = $this->lgefep_switch_image_link_tags( $settings['__dynamic__'], $controls ); 146 } 147 148 foreach ( $controls as $control_name => $control ) { 149 if ( empty( $control['type'] ) || \Elementor\Controls_Manager::REPEATER !== $control['type'] || empty( $control['fields'] ) || empty( $settings[ $control_name ] ) || ! is_array( $settings[ $control_name ] ) ) { 150 continue; 151 } 152 153 foreach ( $settings[ $control_name ] as $index => $item ) { 154 if ( is_array( $item ) && ! empty( $item['__dynamic__'] ) && is_array( $item['__dynamic__'] ) ) { 155 $settings[ $control_name ][ $index ]['__dynamic__'] = $this->lgefep_switch_image_link_tags( $item['__dynamic__'], $control['fields'] ); 156 } 157 } 158 } 159 160 return $settings; 161 } 162 163 /** 164 * Switch acf-repeater-image tags used in URL controls to acf-repeater-image-url. 165 * 166 * @param array $dynamic Dynamic tags keyed by control name. 167 * @param array $controls Controls (or repeater fields). 168 * @return array 169 */ 170 private function lgefep_switch_image_link_tags( array $dynamic, array $controls ) { 171 foreach ( $dynamic as $control_name => $tag_text ) { 172 if ( ! is_string( $tag_text ) || false === strpos( $tag_text, 'name="acf-repeater-image"' ) ) { 173 continue; 174 } 175 176 $type = ''; 177 178 foreach ( $controls as $key => $control ) { 179 $name = isset( $control['name'] ) ? $control['name'] : $key; 180 181 if ( $name === $control_name ) { 182 $type = isset( $control['type'] ) ? $control['type'] : ''; 183 break; 184 } 185 } 186 187 if ( \Elementor\Controls_Manager::URL === $type ) { 188 $dynamic[ $control_name ] = str_replace( 'name="acf-repeater-image"', 'name="acf-repeater-image-url"', $tag_text ); 189 } 190 } 191 192 return $dynamic; 193 } 15 194 16 195 public function lgefep_register_acf_repeater_dynamic_tags($dynamic_tags){ -
loop-grid-extender-for-elementor-pro/trunk/loop-grid-extender-for-elementor-pro.php
r3759887 r3804970 3 3 * Plugin Name: Loop Grid Extender for Elementor - ACF Repeater & Smart Filters 4 4 * Description: Use ACF repeater fields inside Elementor loop items and add smart dynamic dropdown taxonomy filters to the Elementor Loop Grid widget. 5 * Version: 1.2. 15 * Version: 1.2.2 6 6 * Requires at least: 6.5 7 7 * Requires PHP: 7.4 … … 19 19 } 20 20 21 !defined('LGEFEP_VERSION') && define('LGEFEP_VERSION', '1.2. 1');21 !defined('LGEFEP_VERSION') && define('LGEFEP_VERSION', '1.2.2'); 22 22 !defined('LGEFEP_FILE') && define('LGEFEP_FILE', __FILE__); 23 23 !defined('LGEFEP_PLUGIN_DIR') && define('LGEFEP_PLUGIN_DIR', plugin_dir_path(LGEFEP_FILE)); -
loop-grid-extender-for-elementor-pro/trunk/readme.txt
r3759887 r3804970 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 == Changelog == 136 136 137 = Version 1.2.2 | 16/11/2026 = 138 * **Fixed:** ACF Repeater Image dynamic tag outputting http://Array in link/URL fields. 139 137 140 = Version 1.2.1 | 22/10/2026 = 138 141 * **Fixed:** Elementor display conditions not working with ACF repeater field values in Loop Grid.
Note:
See TracChangeset
for help on using the changeset viewer.