esc_html__( 'Import Demo Data', 'ashe' ), 'local_import_file' => trailingslashit( get_template_directory() ) . 'inc/about/import/ashe-demo.xml', 'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'inc/about/import/ashe-widgets.wie', 'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'inc/about/import/ashe-customizer.dat' ) ); } add_filter( 'pt-ocdi/import_files', 'ashe_import_demo_files' ); function ashe_import_demo_files_filter( $default_text ) { // Activate CF7 Plugin After Import if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { $cf7_plugin_link = ''; } elseif ( ashe_check_installed_plugin( 'contact-form-7', 'wp-contact-form-7' ) ) { $cf7_plugin_link = '
  • '. esc_html__( 'Activate - Contact Form 7', 'ashe' ) .'
  • '; } else { $cf7_plugin_link = '
  • '. esc_html__( 'Install/Activate - Contact Form 7', 'ashe' ) .'
  • '; } // Activate RPWWT Plugin After Import if ( is_plugin_active( 'recent-posts-widget-with-thumbnails/recent-posts-widget-with-thumbnails.php' ) ) { $rpwwt_plugin_link = ''; } elseif ( ashe_check_installed_plugin( 'recent-posts-widget-with-thumbnails', 'recent-posts-widget-with-thumbnails' ) ) { $rpwwt_plugin_link = '
  • '. esc_html__( 'Activate - Recent Posts Widget with Thumbnails', 'ashe' ) .'
  • '; } else { $rpwwt_plugin_link = '
  • '. esc_html__( 'Install/Activate - Recent Posts Widget with Thumbnails', 'ashe' ) .'
  • '; } // Activate WPIW Plugin After Import if ( is_plugin_active( 'wp-instagram-widget/wp-instagram-widget.php' ) ) { $wpiw_plugin_link = ''; } elseif ( ashe_check_installed_plugin( 'wp-instagram-widget', 'wp-instagram-widget' ) ) { $wpiw_plugin_link = '
  • '. esc_html__( 'Activate - WP Instagram Widget', 'ashe' ) .'
  • '; } else { $wpiw_plugin_link = '
  • '. esc_html__( 'Install/Activate - WP Instagram Widget', 'ashe' ) .'
  • '; } // Activate WooCommerce Plugin After Import if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { $wcm_plugin_link = ''; } elseif ( ashe_check_installed_plugin( 'woocommerce', 'woocommerce' ) ) { $wcm_plugin_link = '
  • '. esc_html__( 'Activate - WooCommerce', 'ashe' ) .'
  • '; } else { $wcm_plugin_link = '
  • '. esc_html__( 'Install/Activate - WooCommerce', 'ashe' ) .'
  • '; } if ( $rpwwt_plugin_link !== '' || $wpiw_plugin_link !== '' ) { $activate_plugins_notice = esc_html__( 'Recommended (optional): Before you Import Demo Data to get the same demo as shown on our ', 'ashe' ); $activate_plugins_notice .= ''. esc_html__( 'Theme Preview Page', 'ashe' ) .''; $activate_plugins_notice .= esc_html__( ' you need to: ', 'ashe' ); } else { $activate_plugins_notice = ''; } $default_text = substr($default_text, 159); $default_text .= '
    '; if ( $wpiw_plugin_link !== '' || $cf7_plugin_link !== '' || $rpwwt_plugin_link !== '' ) { $default_text .= '

    '. $activate_plugins_notice .'

    '; $default_text .= ''; } if ( $wcm_plugin_link !=='' ) { $default_text .= '

    '. esc_html__( 'If you are planing to sell digital products, it\'s higly recommended to install WooCommerce plugin.', 'ashe' ) .'

    '; $default_text .= ''; } $default_text .= '

    '; return $default_text; } add_filter( 'pt-ocdi/plugin_intro_text', 'ashe_import_demo_files_filter' ); // Install Menus after Import function ashe_after_import_setup() { $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' ); $top_menu = get_term_by( 'name', 'Top Menu', 'nav_menu' ); set_theme_mod( 'nav_menu_locations', array( 'main' => $main_menu->term_id, 'top' => $top_menu->term_id, ) ); // Set WooCommerce Shop Page if ( class_exists( 'WooCommerce' ) ) { update_option('woocommerce_shop_page_id', '647'); } } add_action( 'pt-ocdi/after_import', 'ashe_after_import_setup' ); // Disable PT after Import Notice add_filter( 'pt-ocdi/disable_pt_branding', '__return_true' ); // enqueue ui CSS/JS function ashe_enqueue_about_page_scripts($hook) { if ( 'appearance_page_about-ashe' != $hook ) { return; } // enqueue CSS wp_enqueue_style( 'ashe-about-page-css', get_theme_file_uri( '/inc/about/css/about-ashe-page.css' ), array(), '1.6' ); // Demo Import wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); wp_enqueue_script( 'ashe-about-page-css', get_theme_file_uri( '/inc/about/js/about-ashe-page.js' ), array(), '1.6' ); } add_action( 'admin_enqueue_scripts', 'ashe_enqueue_about_page_scripts' );