| Server IP : 146.59.209.152 / Your IP : 216.73.216.25 Web Server : Apache System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : monpetu ( 144298) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/monpetu/www/leoreno.fr/wp-content/themes/buildexo/demo-import/ |
Upload File : |
<?php
/**
*
* GrowThemes - One Click Demo Import Plugin Integration for Custom Frameworks
*
* @package ocdi
* @version 1.0.0
*
*/
if ( ! function_exists( 'prefix_after_content_import_execution' ) ) {
function prefix_after_content_import_execution( $selected_import_files, $import_files, $selected_index ) {
$downloader = new OCDI\Downloader();
if( ! empty( $import_files[$selected_index]['import_json'] ) ) {
foreach( $import_files[$selected_index]['import_json'] as $index => $import ) {
$file_path = $downloader->download_file( $import['file_url'], 'demo-json-import-file-'. $index . '-'. date( 'Y-m-d__H-i-s' ) .'.json' );
$file_raw = OCDI\Helpers::data_from_file( $file_path );
update_option( $import['option_name'], json_decode( $file_raw, true ) );
}
} else if( ! empty( $import_files[$selected_index]['local_import_json'] ) ) {
foreach( $import_files[$selected_index]['local_import_json'] as $index => $import ) {
$file_path = $import['file_path'];
$file_raw = OCDI\Helpers::data_from_file( $file_path );
update_option( $import['option_name'], json_decode( $file_raw, true ) );
}
}
$ocdi = OCDI\OneClickDemoImport::get_instance();
$log_path = $ocdi->get_log_file_path();
OCDI\Helpers::append_to_file( 'Custom Framework file loaded.', $log_path );
}
add_action('ocdi/after_content_import_execution', 'prefix_after_content_import_execution', 3, 99 );
}