Changeset 3255530
- Timestamp:
- 03/13/2025 05:46:39 PM (13 months ago)
- Location:
- magic-export-import
- Files:
-
- 1 deleted
- 5 edited
-
tags/1.0.2/.DS_Store (modified) (previous)
-
tags/1.0.2/includes/.DS_Store (modified) (previous)
-
tags/1.0.3 (deleted)
-
trunk/class-magic-ex-im-setup.php (modified) (1 diff)
-
trunk/includes/plugin-adapters/class-magic-ex-im-adapter-acf.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
magic-export-import/trunk/class-magic-ex-im-setup.php
r3255427 r3255530 3 3 * Plugin Name: Magic Export & Import 4 4 * Description: The ultimate tool to migrate any content including posts, terms, users, comments, WooCommerce shop orders and ACF Options pages. 5 * Version: 1.0. 35 * Version: 1.0.2 6 6 * Requires at least: 6.2 7 7 * Requires PHP: 7.4 -
magic-export-import/trunk/includes/plugin-adapters/class-magic-ex-im-adapter-acf.php
r3255425 r3255530 293 293 switch ( $acf_field_type ) { 294 294 295 case 'oembed':296 295 case 'textarea': 297 $value = $this->get_unformatted_acf_value( $key, $acf_field_object['key'] ); 296 $new_lines = $acf_field_object['new_lines'] ?? ''; 297 298 if ( 'br' === $new_lines ) { 299 $value = str_replace( array( '<br>', '<br/>', '<br />' ), '', $value ); 300 301 } elseif ( 'wpautop' === $new_lines ) { 302 $value = str_replace( array( '<p>', '</p>' ), array( '', "\n" ), $value ); 303 } 298 304 break; 299 305 … … 622 628 return $acf_field_key; 623 629 } 624 625 /**626 * Gets unformatted ACF value.627 *628 * @param string $parent_field_name Field name to search in.629 * @param string $field_key The key to look for.630 * @param array $unformatted_arr Array to find in.631 * @return mixed|null The value if found, null otherwise or value as it is if it's not array.632 */633 private function get_unformatted_acf_value( $parent_field_name, $field_key, $unformatted_arr = null ) {634 635 $unformatted_arr ??= get_field( $parent_field_name, $this->get_item_acf_id( $parent_field_name ), false );636 637 // If the input is not an array, return it as is.638 if ( ! is_array( $unformatted_arr ) ) {639 return $unformatted_arr;640 }641 642 // If the key exists directly in the array, return its value.643 if ( isset( $unformatted_arr[ $field_key ] ) ) {644 return $unformatted_arr[ $field_key ];645 }646 647 // Otherwise, search recursively in all array elements that are arrays.648 foreach ( $unformatted_arr as $value ) {649 if ( is_array( $value ) ) {650 $result = $this->get_unformatted_acf_value( $parent_field_name, $field_key, $value );651 if ( null !== $result ) {652 return $result;653 }654 }655 }656 657 return null;658 }659 630 } 660 631 -
magic-export-import/trunk/readme.txt
r3255425 r3255530 4 4 Tags: export, import, content migration, csv, custom fields 5 5 Tested up to: 6.7 6 Stable tag: 1.0. 36 Stable tag: 1.0.4 7 7 License: GPL v3 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.txt … … 77 77 == Changelog == 78 78 79 = 1.0.3 =80 * Fixed ACF oembed field type81 82 79 = 1.0.2 = 83 80 * Fixed WooCommerce HPOS Identification for shop orders import
Note: See TracChangeset
for help on using the changeset viewer.