Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : class-merlin-redux-importer.php
<?php
/**
 * Class for the Redux importer.
 *
 * @see https://wordpress.org/plugins/redux-framework/
 *
 * @package Merlin WP
 */

class Merlin_Redux_Importer {
    /**
     * Import Redux data from a JSON file, generated by the Redux plugin.
     *
     * @param array $import_data Array of arrays. Child array contains 'option_name' and 'file_path'.
     *
     * @return boolean
     */
    public static function import($import_data) {
        // Redux plugin is not active!
        if (!class_exists('ReduxFramework') || !class_exists('ReduxFrameworkInstances') || empty($import_data)) {
            return false;
        }

        foreach ($import_data as $redux_item) {
            $redux_options_raw_data = motiox_get_file_contents($redux_item['file_path']);
            $redux_options_data     = json_decode($redux_options_raw_data, true);
            $redux_framework        = ReduxFrameworkInstances::get_instance($redux_item['option_name']);

            if (isset($redux_framework->args['opt_name'])) {
                $redux_framework->set_options($redux_options_data);

                Merlin_Logger::get_instance()->debug(esc_html__('The Redux Framework data was imported', 'motiox'), $redux_item);
            }
        }

        return true;
    }
}
© 2026 GrazzMean-Shell