/** * Performs importing the sample contents to replicate the theme's demo site * * @since 1.7.6 */ function themify_do_import_sample_contents() { do_action('themify_before_demo_import'); themify_import_sample_content_setup(); $import = new Themify_Import(); $import->fetch_attachments = true; $import->import(themify_get_sample_content_file()); // remove extract file if (file_exists($extract_file)) { unlink($extract_file); } if (file_exists(THEME_DIR . '/sample/demo-settings.php')) { require_once THEME_DIR . '/sample/demo-settings.php'; } do_action('themify_after_demo_import'); }
/** * Performs importing the sample contents to replicate the theme's demo site * * @since 1.7.6 */ function themify_do_import_sample_contents() { do_action('themify_before_demo_import'); themify_import_sample_content_setup(); $resource_file = get_template_directory() . '/sample/sample-content.gz'; $cache_dir = themify_get_cache_dir(); $extract_file = $cache_dir['path'] . 'sample-content.xml'; themify_uncompress_gzip($resource_file, $extract_file); $parse_file = file_exists($extract_file) ? $extract_file : $resource_file; $import = new Themify_Import(); $import->fetch_attachments = true; $import->import($parse_file); // remove extract file if (file_exists($extract_file)) { unlink($extract_file); } if (file_exists(THEME_DIR . '/sample/demo-settings.php')) { require_once THEME_DIR . '/sample/demo-settings.php'; } do_action('themify_after_demo_import'); }