also have used this
$requestClone = array(
'action' => 'ns_cloner_process_init',
'clone_mode' => 'core',
'source_id' => 1, // Replace with the correct source site ID
'target_name' => $business_name_edited,
'target_title' => $business_name,
'tables_to_clone' => $tables_to_clone,
'post_types_to_clone' => $cpt_to_clone,
'do_copy_posts' => 1,
'do_copy_files' => 0,
'do_copy_users' => 1,
'debug' => 1,
'flush_cache' => 1,
'clone_nonce' => wp_create_nonce( 'ns_cloner' ),
);
error_log('requestClone' . print_r( $requestClone, TRUE ));
// Load NS Cloner
if (!function_exists('ns_cloner')) {
return;
}
ns_cloner()->init();
// Schedule the cloning operation
ns_cloner()->schedule->add(
$requestClone,
time(), // timestamp of date/time to start cloning - use time() to run immediately
'Your Project Name' // name of your project, required but used only for debugging
);