| Server IP : 62.60.133.156 / Your IP : 216.73.217.51 Web Server : LiteSpeed System : Linux linux24.centraldnserver.com 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64 User : mimradmin ( 1166) PHP Version : 7.4.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mimradmin/theme/digitaz/inc/merlin/includes/ |
Upload File : |
<?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 = file_get_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' , 'digitaz'), $redux_item );
}
}
return true;
}
}