Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // OneClick Demo Importer
- add_filter( 'pt-ocdi/import_files', 'filix_import_files' );
- function filix_import_files() {
- return array(
- array(
- 'import_file_name' => esc_html__('Filix Demo', 'filix'),
- 'local_import_file' => trailingslashit( get_template_directory() ) . 'inc/demo/filix-demo-contents.xml',
- 'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'inc/demo/filix-widgets.wie',
- 'import_preview_image_url' => trailingslashit( get_template_directory_uri() ).'inc/demo/screenshot.png',
- 'import_notice' => esc_html__( 'Install and active all required plugins before you click on the "Import Demo Data" button.', 'filix' ),
- 'preview_url' => 'http://filix.droitthemes.com',
- 'local_import_redux' => array(
- array(
- 'file_path' => trailingslashit( get_template_directory() ) . 'inc/demo/filix-theme-options.json',
- 'option_name' => 'filix_opt',
- ),
- ),
- ),
- );
- }
- add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' );
- function filix_after_import_setup() {
- // Assign menus to their locations.
- $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );
- set_theme_mod( 'nav_menu_locations', array(
- 'main_menu' => $main_menu->term_id,
- )
- );
- // Assign front page and posts page (blog page).
- $front_page_id = get_page_by_title( 'Home' );
- $blog_page_id = get_page_by_title( 'Blog' );
- update_option( 'show_on_front', 'page' );
- update_option( 'page_on_front', $front_page_id->ID );
- update_option( 'page_for_posts', $blog_page_id->ID );
- }
- add_action( 'pt-ocdi/after_import', 'filix_after_import_setup' );
- function filix_plugin_page_setup( $default_settings ) {
- $default_settings['parent_slug'] = 'themes.php';
- $default_settings['page_title'] = esc_html__( 'Filix - One Click Demo Import' , 'filix' );
- $default_settings['menu_title'] = esc_html__( 'Import Filix Demo Data' , 'filix' );
- $default_settings['capability'] = 'import';
- $default_settings['menu_slug'] = 'pt-one-click-demo-import';
- return $default_settings;
- }
- add_filter( 'pt-ocdi/plugin_page_setup', 'filix_plugin_page_setup' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement