function stepped_import_do() { if (!defined('WP_LOAD_IMPORTERS')) { define('WP_LOAD_IMPORTERS', true); } include_once STEPPED_IMPORTER_PATH . 'wordpress-importer/wordpress-importer.php'; include_once STEPPED_IMPORTER_PATH . 'wordpress-importer/import-class.php'; $import_filepath = STEPPED_IMPORTER_PATH . 'data/content.xml'; ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $wp_import->import_posts_pages($import_filepath, $_POST['step_number'], $_POST['number_of_steps']); echo ob_get_contents(); ob_end_clean(); }
} //check if the wp import class is available, this class handles the wordpress XML files. If not, include it if (!class_exists('WPGrade_WP_Import')) { $class_wp_import = wpgrade::themefilepath('inc/import/wordpress-importer/wordpress-importer.php'); if (file_exists($class_wp_import)) { require_once $class_wp_import; } else { $wpGrade_importerError = true; } } if ($wpGrade_importerError !== false) { $response['id'] = new WP_Error('import_posts_pages_noscript', 'The Auto importing script could not be loaded. Please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { if (class_exists('WPGrade_WP_Import')) { include_once 'wordpress-importer/wpgrade-import-class.php'; } if (!is_file($import_filepath . '.xml')) { $response['id'] = new WP_Error('import_posts_pages_nofile', 'The XML file containing the demo data could not be found or could not be read in <pre>' . wpgrade::themefilepath('inc/import/demo-data') . '</pre><br/> You might want to try to set the file permission to 777.<br/>If this doesn\'t work please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $response['id'] = $wp_import->import_posts_pages($import_filepath . '.xml', $response['supplemental']['stepNumber'], $response['supplemental']['numberOfSteps']); //after the last step we assign the menus to the proper locations if ($response['supplemental']['stepNumber'] == $response['supplemental']['numberOfSteps']) { $wp_import->set_menus(); } $response['data'] = ob_get_contents(); ob_end_clean(); } }
require_once $class_wp_importer; } else { $wpGrade_importerError = true; } } //check if the wp import class is available, this class handles the wordpress XML files. If not, include it if (!class_exists('WPGrade_WP_Import')) { $class_wp_import = wpgrade::themefilepath('inc/import/wordpress-importer/wordpress-importer.php'); if (file_exists($class_wp_import)) { require_once $class_wp_import; } else { $wpGrade_importerError = true; } } if ($wpGrade_importerError !== false) { $response['id'] = new WP_Error('import_theme_options_noscript', 'The Auto importing script could not be loaded. Please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { if (class_exists('WPGrade_WP_Import')) { include_once 'wordpress-importer/wpgrade-import-class.php'; } if (!is_file($import_filepath . '.php')) { $response['id'] = new WP_Error('import_theme_options_nofile', 'The PHP file containing the theme options data could not be found or could not be read in <pre>' . wpgrade::themefilepath('inc/import/demo-data') . '</pre><br/> You might want to try to set the file permission to 777.<br/>If this doesn\'t work please use the Theme Options Import/Export and import the .txt file provided in the archive you\'ve received on purchase manually.'); } else { ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $response['id'] = $wp_import->import_theme_options($import_filepath . '.php'); $response['data'] = ob_get_contents(); ob_end_clean(); } }
require_once $class_wp_importer; } else { $wpGrade_importerError = true; } } //check if the wp import class is available, this class handles the wordpress XML files. If not, include it if (!class_exists('WPGrade_WP_Import')) { $class_wp_import = get_template_directory() . '/inc/import/wordpress-importer/wordpress-importer.php'; if (file_exists($class_wp_import)) { require_once $class_wp_import; } else { $wpGrade_importerError = true; } } if ($wpGrade_importerError !== false) { $response['id'] = new WP_Error('import_widgets_menus_noscript', 'The Auto importing script could not be loaded. Please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { if (class_exists('WPGrade_WP_Import')) { include_once 'wordpress-importer/wpgrade-import-class.php'; } if (!is_file($import_filepath . '.php')) { $response['id'] = new WP_Error('import_widgets_menus_nofile', 'The PHP file containing the widgets data could not be found or could not be read in <pre>' . get_template_directory() . 'inc/import/demo-data' . '</pre><br/> You might want to try to set the file permission to 777.'); } else { ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $response['id'] = $wp_import->import_widget_data($import_filepath . '.php'); $response['data'] = ob_get_contents(); ob_end_clean(); } }
} else { $wpGrade_importerError = true; } } //check if the wp import class is available, this class handles the wordpress XML files. If not, include it if (!class_exists('WPGrade_WP_Import')) { $class_wp_import = get_template_directory() . '/inc/import/wordpress-importer/wordpress-importer.php'; if (file_exists($class_wp_import)) { require_once $class_wp_import; } else { $wpGrade_importerError = true; } } if ($wpGrade_importerError !== false) { $error_msg = sprintf('%s <a href="' . admin_url('import.php') . '"> %s</a> %s', esc_html__('The Auto importing script could not be loaded. Please use the ', 'listable'), esc_html__('WordPress default import', 'listable'), esc_html__('and import the .XML file provided in the archive you\'ve received on purchase manually.', 'listable')); $response['id'] = new WP_Error('import_posts_pages_noscript', $error_msg); } else { if (class_exists('WPGrade_WP_Import')) { include_once 'wordpress-importer/wpgrade-import-class.php'; } if (!is_file($import_filepath . '.xml')) { $response['id'] = new WP_Error('import_posts_pages_nofile', 'The XML file containing the demo data could not be found or could not be read in <pre>' . get_template_directory() . 'inc/import/demo-data' . '</pre><br/> You might want to try to set the file permission to 777.<br/>If this doesn\'t work please use the <a href="' . admin_url('import.php') . '">WordPress default import</a> and import the .XML file provided in the archive you\'ve received on purchase manually.'); } else { ob_start(); $wp_import = new wpGrade_import(); $wp_import->fetch_attachments = true; $response['id'] = $wp_import->import_listing_categories($import_filepath . '.xml', $import_filepath . '.php', $response['supplemental']['stepNumber'], $response['supplemental']['numberOfSteps']); $response['data'] = ob_get_contents(); ob_end_clean(); } }