Plugin Directory

Changeset 3255530


Ignore:
Timestamp:
03/13/2025 05:46:39 PM (13 months ago)
Author:
kovalchik8
Message:

Roll back to previous version du to the bugs

Location:
magic-export-import
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • magic-export-import/trunk/class-magic-ex-im-setup.php

    r3255427 r3255530  
    33 * Plugin Name: Magic Export & Import
    44 * Description: The ultimate tool to migrate any content including posts, terms, users, comments, WooCommerce shop orders and ACF Options pages.
    5  * Version: 1.0.3
     5 * Version: 1.0.2
    66 * Requires at least: 6.2
    77 * Requires PHP: 7.4
  • magic-export-import/trunk/includes/plugin-adapters/class-magic-ex-im-adapter-acf.php

    r3255425 r3255530  
    293293            switch ( $acf_field_type ) {
    294294
    295                 case 'oembed':
    296295                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                    }
    298304                    break;
    299305
     
    622628        return $acf_field_key;
    623629    }
    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     }
    659630}
    660631
  • magic-export-import/trunk/readme.txt

    r3255425 r3255530  
    44Tags: export, import, content migration, csv, custom fields
    55Tested up to: 6.7
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77License: GPL v3 or later
    88License URI: https://www.gnu.org/licenses/gpl-3.0.txt
     
    7777== Changelog ==
    7878
    79 = 1.0.3 =
    80 * Fixed ACF oembed field type
    81 
    8279= 1.0.2 =
    8380* Fixed WooCommerce HPOS Identification for shop orders import
Note: See TracChangeset for help on using the changeset viewer.