one-click-demo-import-setting.php (2594B)
1 <?php 2 add_filter( 3 'pt-ocdi/replace_url', 4 function () { 5 return array('https://welbim.smartdemowp.com/'); 6 } 7 ); 8 9 add_filter( 10 'pt-ocdi/domain_name', 11 function () { 12 return array('smartdemowp.com'); 13 } 14 ); 15 16 add_filter( 17 'pt-ocdi/destination_path', 18 function () { 19 return '/wp-content/plugins/welbim-demo-installer/images/'; 20 } 21 ); 22 23 add_filter( 24 'pt-ocdi/import_files', 25 function () { 26 return array( 27 array( 28 'import_file_name' => esc_html__('Welbim', 'chaoz'), 29 'local_import_file' => plugin_dir_path(__FILE__) . 'demo-data/demo1/contents.xml', 30 'local_import_widget_file' => plugin_dir_path(__FILE__) . 'demo-data/demo1/widgets.wie', 31 'import_preview_image_url' => plugin_dir_url(__FILE__) . 'demo-data/demo1/screen-image.png', 32 'local_import_customizer_file' => plugin_dir_path(__FILE__) . 'demo-data/demo1/customize.dat', 33 'import_notice' => esc_html__('Install and active all required plugins before you click on the "Yes! Important" button.', 'chaoz'), 34 'preview_url' => 'https://welbim.smartdemowp.com/', 35 'local_import_redux' => array( 36 array( 37 'file_path' => plugin_dir_path(__FILE__) . 'demo-data/demo1/settings.json', 38 'option_name' => 'welbim_options', 39 ), 40 ), 41 ), 42 ); 43 }, 44 15 45 ); 46 47 48 add_action( 49 'pt-ocdi/after_import', 50 function () { 51 $main_menu = get_term_by('name', 'Primary', 'nav_menu'); 52 $menu_array = array(); 53 if (isset($main_menu->term_id)) { 54 $menu_array['primary'] = $main_menu->term_id; 55 } 56 set_theme_mod( 57 'nav_menu_locations', 58 $menu_array 59 ); 60 $home_page = get_page_by_title('Home Page 01'); 61 update_option('page_on_front', $home_page->ID); 62 update_option('show_on_front', 'page'); 63 $blog_page = get_page_by_title('Blog'); 64 update_option('page_for_posts', $blog_page->ID); 65 } 66 ); 67 68 $token = get_option('envato_theme_license_token'); 69 if ($token != '') { 70 add_filter( 71 'pt-ocdi/plugin_page_setup', 72 function () { 73 return array( 74 'parent_slug' => 'envato-theme-license-dashboard', 75 'page_title' => esc_html__('One Click Demo Import', 'pt-ocdi'), 76 'menu_title' => esc_html__('Import Demo Data', 'pt-ocdi'), 77 'capability' => 'manage_options', 78 'menu_slug' => 'envato-theme-license-one-click-demo-import', 79 ); 80 } 81 ); 82 } else { 83 add_filter( 84 'pt-ocdi/plugin_page_setup', 85 function () { 86 return array( 87 'parent_slug' => '', 88 'page_title' => '', 89 'menu_title' => '', 90 'capability' => '', 91 'menu_slug' => '', 92 ); 93 } 94 ); 95 } 96 97 add_filter('pt-ocdi/disable_pt_branding', '__return_true');