File manager - Edit - /home/verseaumee/TF89388/wp-content/plugins/noisa-toolkit/includes/importer/class-importer-data.php
Back
<?php /** * Rascals Importer Data * * * @author Rascals Themes * @category Core * @package Noisa Toolkit * @version 1.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class RascalsImporterData extends RascalsImporter { /** * Set framewok * * * @since 0.0.3 * * @var string */ public $theme_options_framework = 'RascalsPanel'; public $flag_as_imported; /** * Show Console * * * @since 0.0.3 * * @var string */ public $wp_importer_console = 'hidden'; // hidden or empty /** * Holds a copy of the object for easy reference. * * @since 0.0.1 * * @var object */ private static $instance; /** * Set the key to be used to store theme options * * @since 0.0.2 * * @var array */ public $importer_options; /** * Set the key to be used to store theme options * * @since 0.0.2 * * @var string */ public $theme_option_name = 'noisa_panel_opts'; /** * Holds a copy of the widget settings * * @since 0.0.2 * * @var string */ public $widget_import_results; /** * Required plugins * * @since 0.0.3 * * @var array */ public $required_plugins; /** * Constructor. Hooks all interactions to initialize the class. * * @since 0.0.1 */ public function __construct() { // Set demos path $this->demo_files_path = dirname(__FILE__) . '/demo-files/'; /* ================================================== Main Demos ================================================== */ $this->importer_options = array( /* DEMO1 - Dark -------------------------------- */ array( 'id' => 'demo1', 'name' => 'Demo 1 (Dark)', 'thumb' => 'demo1/thumb.jpg', 'content_files' => array( array( 'file_path' => 'demo1/content_media.xml', ), array( 'file_path' => 'demo1/content.xml', ), ), 'widget_file' => 'demo1/widgets.wie', 'customizer_file' => 'demo1/customizer.dat', 'panel_options_file' => 'demo1/theme_options.txt', 'rev_sliders_files' => 'rev_sliders', 'import_notice' => '', ), /* DEMO2 - Light -------------------------------- */ array( 'id' => 'demo2', 'name' => 'Demo 1 (Light)', 'thumb' => 'demo2/thumb.jpg', 'content_files' => array( array( 'file_path' => 'demo2/content_media.xml', ), array( 'file_path' => 'demo2/content.xml', ), ), 'widget_file' => 'demo2/widgets.wie', 'customizer_file' => 'demo2/customizer.dat', 'panel_options_file' => 'demo2/theme_options.txt', 'rev_sliders_files' => 'rev_sliders', 'import_notice' => '', ), ); $this->required_plugins = array( array( 'path' => 'js_composer/js_composer.php', 'name' => esc_html__( 'WPBakery Visual Composer - The most professional WordPress page builder plugin, it\'s weight and high efficiency to help you build any layout design quickly.', 'noisa-toolkit' ) ), array( 'path' => 'kirki/kirki.php', 'name' => esc_html__( 'Kirki - Theme customization options.', 'noisa-toolkit' ) ), array( 'path' => 'noisa-toolkit/noisa-toolkit.php', 'name' => esc_html__( 'Noisa Toolkit - This is a complimentary plugin for the Rascals WordPress themes. You can use it to create, manage and update Custom Posts Types, Widgets, Modules, Customizer Options.', 'noisa-toolkit' ) ) ); self::$instance = $this; parent::__construct(); } /** * Run this function before demo import * @param string $demo_id - Demo imported ID * @return void */ public function before_import(){ /* Remove Default Widgets from sidebar -------------------------------- */ /* Sidebar slugname */ $sidebar = 'primary-sidebar'; $sidebars_widgets = get_option( 'sidebars_widgets' ); if ( isset( $sidebars_widgets ) && is_array( $sidebars_widgets ) ) { if ( isset( $sidebars_widgets[$sidebar] ) ) { $sidebars_widgets[$sidebar] = array(); update_option( 'sidebars_widgets', $sidebars_widgets ); } } } /** * Run this function after demo import * @param string $demo_id - Demo imported ID * @return void */ public function after_import($demo_id){ /* ================================================== DEMO 1 or 2 ================================================== */ if ( $demo_id === 'demo1' || $demo_id === 'demo2' ) { /* Set homepage -------------------------------- */ /* Homepage slugname */ $homepage_name = 'Home - Music Agency'; $home_id = get_page_by_title( $homepage_name ); if ( isset( $home_id ) ) { update_option( 'page_on_front', $home_id->ID ); update_option( 'show_on_front', 'page' ); } /* Set Menus Locations -------------------------------- */ /* Get menu name depends on demo */ $menu_name_1 = 'Sidebar Menu'; $menu_location_1 = 'sidebar'; $menu_name_2 = 'Top menu'; $menu_location_2 = 'top'; $menu_1 = get_term_by( 'name', $menu_name_1, 'nav_menu' ); $menu_2 = get_term_by( 'name', $menu_name_2, 'nav_menu' ); if ( $menu_1 ) { set_theme_mod( 'nav_menu_locations', array( $menu_location_1 => $menu_1->term_id ) ); } if ( $menu_2 ) { set_theme_mod( 'nav_menu_locations', array( $menu_location_2 => $menu_2->term_id ) ); } $this->flag_as_imported['menus'] = true; } // end demo1 } }
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings