require_class($_REQUEST['helper']); } add_action( 'wp_ajax_et_panel_ajax', array($this, 'et_panel_ajax') ); add_action('wp_ajax_et_close_installation_video', array($this, 'et_close_installation_video')); $current_theme = wp_get_theme(); $this->theme_name = strtolower( preg_replace( '#[^a-zA-Z]#', '', $current_theme->get( 'Name' ) ) ); add_action( 'admin_init', array( $this, 'admin_redirects' ), 30 ); add_action('admin_init',array($this,'add_page_admin_script'), 1140); add_filter('admin_body_class', array($this, 'admin_body_class')); if(!is_child_theme()){ add_action( 'after_switch_theme', array( $this, 'switch_theme' ) ); } if ( ! $this->set_page_data() ){ return; } if (isset($this->page['class']) && ! empty($this->page['class'])){ $this->require_class($this->page['class']); } // Stas $this->init_vars(); } public static function add_svg_support( $mimes ) { $mimes['svg'] = 'image/svg+xml'; $mimes['json'] = 'application/json'; return $mimes; } /** * Correct SVG file uploads to make them pass the WP check. * * WP upload validation relies on the fileinfo PHP extension, which causes inconsistencies. * E.g. json file type is application/json but is reported as text/plain. * ref: https://core.trac.wordpress.org/ticket/45633 * * @access public * @since 4.3.4 * @param array $data Values for the extension, mime type, and corrected filename. * @param string $file Full path to the file. * @param string $filename The name of the file (may differ from $file due to * $file being in a tmp directory). * @param string[] $mimes Array of mime types keyed by their file extension regex. * @param string|bool $real_mime The actual mime type or false if the type cannot be determined. * * @return array */ public function correct_svg_filetype( $data, $file, $filename, $mimes, $real_mime = false ) { // If both ext and type are. if ( ! empty( $data['ext'] ) && ! empty( $data['type'] ) ) { return $data; } $wp_file_type = wp_check_filetype( $filename, $mimes ); if ( 'svg' === $wp_file_type['ext'] ) { $data['ext'] = 'svg'; $data['type'] = 'image/svg+xml'; } return $data; } public function init_vars() { $this->settingJsConfig = array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'resetOptions' => __( 'All your settings will be reset to default values. Are you sure you want to do this ?', 'xstore' ), 'pasteYourOptions' => __( 'Please, paste your options there.', 'xstore' ), 'loadingOptions' => __( 'Loading options', 'xstore' ) . '...', 'ajaxError' => __( 'Ajax error', 'xstore' ), 'nonce' => wp_create_nonce( 'xstore_panel_saving_nonce' ), 'audioPlaceholder' => ETHEME_BASE_URI.'framework/panel/images/audio.png', ); return $this->settingJsConfig; } public static function get_instance() { if ( ! self::$instance ) { self::$instance = new self(); } return self::$instance; } public function admin_body_class($class) { global $pagenow; $screen = get_current_screen(); $screen_id = $screen ? $screen->id : ''; if ( strpos($screen_id, 'et-panel') ) { $class .= ' et-'.get_option('et_panel_dark_light_default', 'light').'-mode'; } return $class; } /** * enqueue scripts for current panel page * * @version 1.0.2 * @since 7.0.0 */ public function add_page_admin_script(){ wp_register_script('etheme_panel_global',ETHEME_BASE_URI.'framework/panel/js/global.min.js', array('jquery','etheme_admin_js'), false,true); wp_localize_script( 'etheme_panel_global', 'XStorePanelConfig', array( 'messages' => array( 'register_licence' => esc_html__('Oops... There was an issue updating your theme. We could not validate your purchase code. Please register the theme and try again, or contact our support forum for more information.', 'xstore'), ) )); if ( isset($this->page['script']) && ! empty($this->page['script']) ){ wp_register_script('etheme_panel_'.$this->page['script'],ETHEME_BASE_URI.'framework/panel/js/'.$this->page['script'].'.js', array('jquery','etheme_admin_js'), false,true); // prevent loading this JS file and load it only in case it requires from the other files if ( !in_array($this->page['script'], array('system_requirements.min'))) wp_enqueue_script('etheme_panel_'.$this->page['script']); switch ($this->page['script']) { case 'patcher.min': wp_localize_script( 'etheme_panel_'.$this->page['script'], 'XStorePanelPatcherConfig', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'success' => esc_html__('Successfully applied', 'xstore'), 'applied_btn' => ''. ' ' . esc_html__('Applied', 'xstore').'', 'error_btn' => ''. ' ' . esc_html__('Error', 'xstore').'', 'apply_all' => esc_html__('Before proceeding, please confirm that you wish to apply all patches.', 'xstore'), 'backup_info' => esc_html__('We recommend that you make backups of your website before making any changes.', 'xstore'), 'question' => esc_html__('Before proceeding, please confirm that you wish to apply this patch.', 'xstore'), 'test_mode' => isset($_GET['xstore-patches-test-mode']), 'nonce' => wp_create_nonce( 'xstore_patches_apply_nonce' ), 'file_will_modify' => esc_html__('Please, note that the following file will be modified: {{file}}', 'xstore'), 'files_will_modify' => esc_html__('Please, note that the following files will be modified: {{files}}', 'xstore') ) ); break; case 'welcome.min': wp_register_script( 'slick_carousel', get_template_directory_uri() . '/js/libs/slick.min.js', array('jquery') ); wp_register_style( 'slick-carousel', get_template_directory_uri() . '/css/libs/slick.css' ); break; case 'demos.min': case 'plugins.min': case 'sales_booster.min': wp_enqueue_script( 'jquery_lazyload'); break; } } if ( isset($this->page['template']) && ! empty($this->page['template']) ){ if ( etheme_is_activated() && get_option('et_documentation_beacon', false) !== 'off') wp_enqueue_script('etheme_panel_documentation',ETHEME_BASE_URI.'framework/panel/js/documentation.min.js', array('jquery','etheme_admin_js'), false,true); if ( in_array($this->page['template'], array('changelog', 'theme-builders')) ) wp_enqueue_script('etheme_panel_global'); } if (did_action('etheme_panel_page_has_options') ) { wp_enqueue_script('etheme_panel_global'); wp_enqueue_script( 'xstore_panel_settings_admin_js', ETHEME_BASE_URI.'framework/panel/js/settings/save_action.min.js' ); wp_localize_script( 'xstore_panel_settings_admin_js', 'XStorePanelSettingsConfig', $this->settingJsConfig ); } } // deprecated since v9.4 but need to be to prevent fatal errors in XStore AMO/White label branding public function add_page_admin_settings_scripts() { // wp_enqueue_script( 'xstore_panel_settings_admin_js', ETHEME_BASE_URI.'framework/panel/js/settings/save_action.min.js', array('wp-color-picker') ); // // wp_localize_script( 'xstore_panel_settings_admin_js', 'XStorePanelSettingsConfig', $this->settingJsConfig ); } // deprecated since v9.4 but need to be to prevent fatal errors in XStore AMO/White label branding public function add_page_admin_settings_xstore_icons() { } public function xstore_panel_icons_fonts_enqueue() { $dir_uri = get_template_directory_uri(); $icons_type = ( etheme_get_option('bold_icons', 0) ) ? 'bold' : 'light'; wp_register_style( 'xstore-icons-font', false ); wp_enqueue_style( 'xstore-icons-font' ); wp_add_inline_style( 'xstore-icons-font', "@font-face { font-family: 'xstore-icons'; src: url('".$dir_uri."/fonts/xstore-icons-".$icons_type.".ttf') format('truetype'), url('".$dir_uri."/fonts/xstore-icons-".$icons_type.".woff2') format('woff2'), url('".$dir_uri."/fonts/xstore-icons-".$icons_type.".woff') format('woff'), url('".$dir_uri."/fonts/xstore-icons-".$icons_type.".svg#xstore-icons') format('svg'); font-weight: normal; font-style: normal; font-display: swap; }" ); wp_enqueue_style( 'xstore-icons-font-style', $dir_uri . '/css/xstore-icons.css' ); } /** * Set panel page data * * @version 1.0.2 * @since 7.0.0 * @log added sales_booster actions */ public function set_page_data(){ if (! isset($_REQUEST['page'])){ return false; } switch ( $_REQUEST['page'] ) { case 'et-panel-system-requirements': $this->page['template'] = 'system-requirements'; $this->page['script'] = 'system_requirements.min'; break; case 'et-panel-changelog': $this->page['template'] = 'changelog'; break; case 'et-panel-support': $this->page['template'] = 'support'; $this->page['class'] = 'youtube'; $this->page['script'] = 'support.min'; break; case 'et-panel-demos': $this->page['template'] = 'demos'; $this->page['script'] = 'demos.min'; break; case 'et-panel-patcher': $this->page['template'] = 'patcher'; $this->page['script'] = 'patcher.min'; break; case 'et-panel-custom-fonts': $this->page['template'] = 'custom-fonts'; break; case 'et-panel-sales-booster': $this->page['script'] = 'sales_booster.min'; $this->page['template'] = 'sales-booster'; $this->page['class'] = 'sales-booster'; do_action('etheme_panel_page_has_options'); break; case 'et-panel-maintenance-mode': $this->page['script'] = 'maintenance_mode.min'; $this->page['template'] = 'maintenance-mode'; $this->page['class'] = 'maintenance-mode'; break; case 'et-panel-social-authentication': $this->page['script'] = 'instagram.min'; $this->page['template'] = 'social-authentication'; $this->page['class'] = 'instagram'; break; case 'et-panel-social': $this->page['script'] = 'instagram.min'; $this->page['template'] = 'instagram'; $this->page['class'] = 'instagram'; break; case 'et-panel-open-ai': $this->page['script'] = 'ai.min'; $this->page['template'] = 'ai'; // $this->page['class'] = 'ai'; break; case 'et-panel-plugins': $this->page['script'] = 'plugins.min'; $this->page['template'] = 'plugins'; $this->page['class'] = 'plugins'; break; case 'et-panel-email-builder': $this->page['script'] = 'email_builder.min'; $this->page['template'] = 'email-builder'; $this->page['class'] = 'email-builder'; break; case 'et-panel-theme-builders': $this->page['script'] = 'theme-builder.min'; $this->page['template'] = 'theme-builders'; $this->page['class'] = 'plugins'; break; case 'et-panel-white-label-branding': case 'et-panel-xstore-amp': do_action('etheme_panel_page_has_options'); break; case 'et-panel-search-stats': // do_action('etheme_panel_page_has_options'); break; default: if ( strpos($_REQUEST['page'], 'et-panel') !== false ) { if ( $_REQUEST['page'] == 'et-panel-email-builder-templates' ) { wp_safe_redirect( admin_url('edit.php?post_type=viwec_template') ); } else { $this->page['template'] = 'welcome'; $this->page['script'] = 'welcome.min'; } } break; } return true; } /** * Require page classes * * require page classes when ajax process and return the callbacks for ajax requests * * @version 1.0.0 * @since 7.0.0 * @param string $class class filename */ public function require_class($class=''){ if (! $class){ return; } require_once( apply_filters('etheme_file_url', ETHEME_CODE . 'panel/classes/'.sanitize_file_name($class).'.php') ); } /** * Global panel ajax * * require page classes when ajax process and return the callbacks for ajax requests * * @version 1.0.2 * @since 7.0.0 * @todo remove this * @log added sales_booster actions */ public function et_panel_ajax(){ if ( isset($_POST['action_type']) ){ switch ( $_POST['action_type'] ) { case 'et_instagram_user_add': $this->require_class('instagram'); $class = new Instagram(); $class->et_instagram_user_add(); break; case 'et_instagram_user_remove': $this->require_class('instagram'); $class = new Instagram(); $class->et_instagram_user_remove(); break; case 'et_instagram_save_settings': $this->require_class('instagram'); $class = new Instagram(); $class->et_instagram_save_settings(); break; case 'et_email_builder_switch_default': $this->require_class('email-builder'); $class = new EmailBuilder(); $class->et_email_builder_switch_default(); break; case 'et_documentation_beacon': $this->require_class('youtube'); $class = new YouTube(); $class->et_documentation_beacon(); break; case 'et_email_builder_switch_dev_mode_default': $this->require_class('email-builder'); $class = new EmailBuilder(); $class->et_email_builder_switch_dev_mode_default(); break; case 'et_maintenance_mode_switch_default': $this->require_class('maintenance-mode'); $class = new MaintenanceMode(); $class->et_maintenance_mode_switch_default(); break; case 'et_panel_dark_light_switch_default': $this->et_panel_dark_light_switch_default(); break; default: break; } } } public function et_panel_dark_light_switch_default(){ update_option( 'et_panel_dark_light_default', $_POST['value']); die(); } /** * Add admin panel dashboard pages to admin menu. * * @since 5.0.0 * @version 1.0.3 */ public function et_add_menu_page(){ $system = class_exists('Etheme_System_Requirements') ? Etheme_System_Requirements::get_instance() : new Etheme_System_Requirements(); $system->system_test(); $result = $system->result(); $allow_full_access = !etheme_activation_required(); $allow_force_access_woocommerce_features = true; $is_et_core = class_exists('ETC\App\Controllers\Admin\Import'); $is_activated = etheme_is_activated(); $is_wc = class_exists('WooCommerce'); $is_elementor = class_exists('\Elementor\Plugin'); $info_base = ''; $info = str_replace('{{info_color}}', 'var(--et_admin_orange-color)', $info_base); $info = ''; $update_info = str_replace('{{info_color}}', 'var(--et_admin_green-color)', $info_base); $update_info = ''; $icon = ETHEME_CODE_IMAGES . 'wp-icon.svg'; $label = 'XStore'; $plugin_label = 'XStore'; $show_pages = array( 'welcome', 'system_requirements', 'demos', 'plugins', 'patcher', 'open_ai', 'customize', 'email_builder', 'sales_booster', 'custom_fonts', 'maintenance_mode', 'social_authentication', 'social', 'support', 'changelog', 'sponsors' ); $hide_theme_builders = false; $xstore_branding_settings = get_option( 'xstore_white_label_branding_settings', array() ); if ( count($xstore_branding_settings) ) { if (isset($xstore_branding_settings['control_panel'])) { if ($xstore_branding_settings['control_panel']['icon']) $icon = $xstore_branding_settings['control_panel']['icon']; if ($xstore_branding_settings['control_panel']['label']) $label = $xstore_branding_settings['control_panel']['label']; if (isset($xstore_branding_settings['control_panel']['hide_theme_builders']) && $xstore_branding_settings['control_panel']['hide_theme_builders'] == 'on') $hide_theme_builders = true; $show_pages_parsed = array(); foreach ($show_pages as $show_page) { if (isset($xstore_branding_settings['control_panel']['page_' . $show_page])) $show_pages_parsed[] = $show_page; }; $show_pages = $show_pages_parsed; } if ( isset($xstore_branding_settings['plugins_data'] ) ) { if (isset($xstore_branding_settings['plugins_data']['label']) && !empty($xstore_branding_settings['plugins_data']['label'])) $plugin_label = $xstore_branding_settings['plugins_data']['label']; } } $priorities = array( 'welcome' => 52, 'theme-builders' => 52.2, 'staticblocks' => 53.2, // in another file 'etheme_portfolio' => 54, // in another file 'sales-booster' => 52.3, 'widgets' => 52.35, 'email-builder' => 52.4, 'theme-options' => 52.1, 'etheme_slides' => 53.1, 'etheme_mega_menus' => 53 ); $icons = array( 'welcome' => $icon, 'theme-builders' => 'dashicons-schedule', 'staticblocks' => 'dashicons-welcome-widgets-menus', // in another file 'etheme_portfolio' => 'dashicons-images-alt', 'sales-booster' => 'dashicons-chart-bar', 'widgets' => 'dashicons-align-right', 'email-builder' => 'dashicons-email-alt', 'theme-options' => 'dashicons-admin-settings', 'etheme_slides' => 'dashicons-images-alt2', 'etheme_mega_menus' => 'dashicons-welcome-widgets-menus' ); $is_update_support = 'active'; $is_subscription = false; if ( $is_activated ){ if (apply_filters('etheme_hide_updates', false)){ $is_update_support = 'active'; $is_update_available = false; } else { $check_update = new ETheme_Version_Check(); $is_update_available = $check_update->is_update_available(); $is_update_support = 'active'; //$check_update->get_support_status(); $is_subscription = $check_update->is_subscription; } } else { $is_update_available = false; } if ($is_activated && $is_update_support !='active' && $result){ if ($is_update_support == 'expire-soon'){ $info = str_replace('{{info_color}}', 'var(--et_admin_orange-color)', $info_base); } else { $info = str_replace('{{info_color}}', 'var(--et_admin_red-color)', $info_base); } } else if ($is_activated && $is_update_available && $result ){ $info = $update_info; } elseif(!$is_activated){ $info = str_replace('{{info_color}}', 'var(--et_admin_orange-color)', $info_base); } // temporary disable setter for notices // @todo remove when alerts will be fully redesigned $info = ''; $server_label = esc_html__( 'System Status', 'xstore' ); if (!$result && ($is_activated || $allow_full_access)){ $server_label = esc_html__( 'Server Reqs.', 'xstore' ); $server_label .= ' ' . $info; } add_menu_page( $label . ' ' . ( ( (!$is_activated && !$allow_full_access) || !$result || $is_update_available || $is_update_support !='active' ) ? $info : '' ), $label . ' ' . ( ( (!$is_activated && !$allow_full_access) || !$result || $is_update_available || $is_update_support !='active' ) ? $info : '' ), 'manage_options', 'et-panel-welcome', array( $this, 'etheme_panel_page' ), $icons['welcome'], $priorities['welcome'] ); if ( in_array('welcome', $show_pages) ) { add_submenu_page( 'et-panel-welcome', esc_html__( 'Dashboard', 'xstore' ) .' '. ( (!$is_activated && !$allow_full_access) || ($is_update_support !='active' && $result) ? $info : ''), esc_html__( 'Dashboard', 'xstore' ) .' '. ( (!$is_activated && !$allow_full_access) || ($is_update_support !='active' && $result) ? $info : ''), 'manage_options', 'et-panel-welcome', array( $this, 'etheme_panel_page' ) ); } if ( (!$is_activated || !$is_et_core) || $allow_full_access ) { if ( in_array('system_requirements', $show_pages) ) { add_submenu_page( 'et-panel-welcome', $server_label, $server_label, 'manage_options', 'et-panel-system-requirements', array( $this, 'etheme_panel_page' ) ); } } if ( $is_activated || $allow_full_access ) { // make active link if theme is active if ( in_array('demos', $show_pages) ) { add_submenu_page( 'et-panel-welcome', esc_html__( 'Import Demos 130+', 'xstore' ), esc_html__( 'Import Demos 130+', 'xstore' ), 'manage_options', 'et-panel-demos', array( $this, 'etheme_panel_page' ) ); } if ( in_array('plugins', $show_pages) ) { add_submenu_page( 'et-panel-welcome', esc_html__( 'Plugins Installer', 'xstore' ), esc_html__( 'Plugins Installer', 'xstore' ), 'manage_options', 'et-panel-plugins', array( $this, 'etheme_panel_page' ) ); } // tweak this page link to make link available always // but is hidden with css if is disabled from XStore White Label Branding plugin $available_patches_affix = ''; // if ( class_exists('Etheme_Patcher') ) { // $patcher = Etheme_Patcher::get_instance(); // $available_patches = count($patcher->get_available_patches(ETHEME_THEME_VERSION)); // if ( $available_patches ) { // $available_patches_affix = ' '. // $available_patches. // ''; // } // } add_submenu_page( 'et-panel-welcome', (in_array('patcher', $show_pages) ? esc_html__( 'Patcher', 'xstore' ) : ''), (in_array('patcher', $show_pages) ? esc_html__( 'Patcher', 'xstore' ) : '') . $available_patches_affix, 'manage_options', 'et-panel-patcher', array( $this, 'etheme_panel_page' ) ); } if ( ($is_activated || $allow_full_access) && in_array('custom_fonts', $show_pages) ) { add_submenu_page( 'et-panel-welcome', esc_html__( 'Custom Fonts', 'xstore' ), esc_html__( 'Custom Fonts', 'xstore' ), 'manage_options', 'et-panel-custom-fonts', array( $this, 'etheme_panel_page' ) ); } if ( ($is_activated && $is_et_core) || $allow_full_access ) { $is_amp = class_exists('XStore_AMP'); if ( !$is_amp ) { add_submenu_page( 'et-panel-welcome', esc_html__('AMP XStore', 'xstore'), esc_html__('AMP XStore', 'xstore'), 'manage_options', (!$is_amp || !$is_activated ? 'et-panel-plugins&plugin=xstore-amp' : 'et-panel-xstore-amp'), (!$is_amp || !$is_activated ? array($this, 'etheme_panel_page') : '') ); } if (in_array('open_ai', $show_pages)) { add_submenu_page( 'et-panel-welcome', esc_html__('ChatGPT', 'xstore'), esc_html__('ChatGPT', 'xstore'), 'manage_options', 'et-panel-open-ai', array($this, 'etheme_panel_page') ); } if (in_array('social_authentication', $show_pages)) { add_submenu_page( 'et-panel-welcome', esc_html__('Social Authentication', 'xstore'), esc_html__('Social Authentication', 'xstore'), 'manage_options', 'et-panel-social-authentication', array($this, 'etheme_panel_page') ); } if (in_array('social', $show_pages)) { add_submenu_page( 'et-panel-welcome', esc_html__('API Integrations', 'xstore'), esc_html__('API Integrations', 'xstore'), 'manage_options', 'et-panel-social', array($this, 'etheme_panel_page') ); } if (in_array('maintenance_mode', $show_pages)) { add_submenu_page( 'et-panel-welcome', esc_html__('Maintenance Mode', 'xstore'), esc_html__('Maintenance Mode', 'xstore'), 'manage_options', 'et-panel-maintenance-mode', array($this, 'etheme_panel_page') ); } if ( in_array('support', $show_pages) ) { add_submenu_page( 'et-panel-welcome', esc_html__( 'Tutorials & Support', 'xstore' ), esc_html__( 'Tutorials & Support', 'xstore' ), 'manage_options', 'et-panel-support', array( $this, 'etheme_panel_page' ) ); } if (in_array('system_requirements', $show_pages)) { add_submenu_page( 'et-panel-welcome', $server_label, $server_label, 'manage_options', 'et-panel-system-requirements', array($this, 'etheme_panel_page') ); } if ( in_array('changelog', $show_pages) ) { add_submenu_page( 'et-panel-welcome', esc_html__( 'Changelog', 'xstore' ), esc_html__( 'Changelog', 'xstore' ), 'manage_options', 'et-panel-changelog', array( $this, 'etheme_panel_page' ) ); } } if ( ($is_activated || $allow_full_access) && in_array('sponsors', $show_pages) ) { add_submenu_page( 'et-panel-welcome', esc_html__('SEO Experts', 'xstore'), esc_html__('SEO Experts', 'xstore'), 'manage_options', 'https://overflowcafe.com/am/aff/go/8theme', '' ); } //add_submenu_page( // 'et-panel-welcome', // esc_html__( 'Customization Services', 'xstore' ), // esc_html__( 'Customization Services', 'xstore' ), // 'manage_options', // 'https://wpkraken.io/?ref=8theme', // '' //); // add_submenu_page( // 'et-panel-welcome', // esc_html__( 'Woocommerce Hosting', 'xstore' ), // esc_html__( 'Woocommerce Hosting', 'xstore' ), // 'manage_options', // 'http://www.bluehost.com/track/8theme', // '' // ); add_submenu_page( 'et-panel-welcome', esc_html__( 'Get WPML Plugin', 'xstore' ), esc_html__( 'Get WPML Plugin', 'xstore' ), 'manage_options', 'https://wpml.org/?aid=46060&affiliate_key=YI8njhBqLYnp&dr', '' ); // add_submenu_page( // 'et-panel-welcome', // esc_html__( 'Hosting Service', 'xstore' ), // esc_html__( 'Hosting Service', 'xstore' ), // 'manage_options', // 'https://www.siteground.com/index.htm?afcode=37f764ca72ceea208481db0311041c62', // '' // ); // if (!$is_subscription){ // add_submenu_page( // 'et-panel-welcome', // esc_html__( 'Go Unlimited', 'xstore' ), // esc_html__( 'Go Unlimited', 'xstore' ), // 'manage_options', // 'https://www.8theme.com/#price-section-anchor', // '' // ); // } // add_submenu_page( // 'et-panel-welcome', // esc_html__( 'WooCommerce Plugins', 'xstore' ), // esc_html__( 'WooCommerce Plugins', 'xstore' ), // 'manage_options', // 'https://yithemes.com/product-category/plugins/?refer_id=1028760', // '' // ); // if ( $is_et_core ) { // add_submenu_page( // 'et-panel-welcome', // esc_html__( 'Rate Theme', 'xstore' ), // esc_html__( 'Rate Theme', 'xstore' ), // 'manage_options', // 'https://themeforest.net/item/xstore-responsive-woocommerce-theme/reviews/15780546', // '' // ); // } if ( ($allow_force_access_woocommerce_features || $is_wc) && in_array( 'email_builder', $show_pages ) ) { add_menu_page( esc_html__( 'Email Builder', 'xstore' ), esc_html__( 'Email Builder', 'xstore' ), 'manage_options', 'et-panel-email-builder', array( $this, 'etheme_panel_page' ), $icons['email-builder'], $priorities['email-builder'] ); if ( get_option('etheme_built_in_email_builder', false) ) { add_submenu_page( 'et-panel-email-builder', esc_html__( 'Email Builder', 'xstore' ), esc_html__( 'General Settings', 'xstore'), 'manage_options', 'et-panel-email-builder', array($this, 'etheme_panel_page') ); add_submenu_page( 'et-panel-email-builder', esc_html__('View Templates', 'xstore'), esc_html__('View Templates', 'xstore'), 'manage_options', 'et-panel-email-builder-templates', array($this, 'etheme_panel_page') ); } } if ( ($is_et_core && $is_activated) || $allow_full_access ) { add_menu_page( esc_html__('Widgets', 'xstore'), esc_html__('Widgets', 'xstore'), 'edit_theme_options', admin_url('widgets.php'), '', $icons['widgets'], $priorities['widgets'] ); } if ( ($is_activated || $allow_full_access) && ($allow_force_access_woocommerce_features || $is_wc) && in_array( 'sales_booster', $show_pages ) ) { add_menu_page( esc_html__( 'Sales Booster', 'xstore' ), esc_html__( 'Sales Booster', 'xstore' ), 'manage_options', 'et-panel-sales-booster', array( $this, 'etheme_panel_page' ), $icons['sales-booster'], $priorities['sales-booster'] ); add_submenu_page( 'et-panel-sales-booster', esc_html__( 'Sales Booster', 'xstore' ), esc_html__( 'All Features', 'xstore' ), 'manage_options', 'et-panel-sales-booster', array($this, 'etheme_panel_page') ); $sales_booster_main_features = array( 'fake_sale_popup' => esc_html__('Fake Sale Popup', 'xstore'), 'cart_checkout_countdown' => esc_html__( 'Cart Countdown', 'xstore' ), 'cart_checkout_progress_bar' => esc_html__( 'Progress Bar', 'xstore' ), 'fake_live_viewing' => esc_html__('Fake Live Viewing', 'xstore'), 'fake_product_sales' => esc_html__('Item Sold Indicator', 'xstore'), 'customer_reviews_advanced' => esc_html__('Advanced Reviews', 'xstore'), 'quantity_discounts' => esc_html__('Quantity Discounts', 'xstore'), 'safe_checkout' => esc_html__('Safe Checkout', 'xstore'), ); foreach ($sales_booster_main_features as $sales_booster_main_feature_key => $sales_booster_main_feature_title) { add_submenu_page( 'et-panel-sales-booster', esc_html__( 'Sales Booster', 'xstore' ), $sales_booster_main_feature_title, 'manage_options', 'et-panel-sales-boosterðeme-sales-booster-tab='.$sales_booster_main_feature_key, array($this, 'etheme_panel_page') ); } add_submenu_page( 'et-panel-sales-booster', esc_html__( 'Sales Booster', 'xstore' ), esc_html__( 'More Features', 'xstore' ) . ' →', 'manage_options', 'et-panel-sales-booster', array($this, 'etheme_panel_page') ); } if ( $allow_full_access && !$is_et_core ) { add_menu_page( esc_html__( 'Static Blocks', 'xstore' ), esc_html__( 'Static Blocks', 'xstore' ), 'manage_options', 'et-panel-staticblocks_post_type', array( $this, 'etheme_panel_page' ), $icons['staticblocks'], $priorities['staticblocks'] ); } if ( $allow_full_access && (!$is_et_core || !$is_elementor) ) { add_menu_page( esc_html__( 'Mega Menus', 'xstore' ), esc_html__( 'Mega Menus', 'xstore' ), 'manage_options', 'et-panel-etheme_mega_menus_post_type', array( $this, 'etheme_panel_page' ), $icons['etheme_mega_menus'], $priorities['etheme_mega_menus'] ); add_menu_page( esc_html__( 'Slides', 'xstore' ), esc_html__( 'Slides', 'xstore' ), 'manage_options', 'et-panel-etheme_slides_post_type', array( $this, 'etheme_panel_page' ), $icons['etheme_slides'], $priorities['etheme_slides'] ); } if ( $allow_full_access && !$is_et_core ) { add_menu_page( esc_html__( 'Portfolio', 'xstore' ), esc_html__( 'Portfolio', 'xstore' ), 'manage_options', 'et-panel-etheme_portfolio_post_type', array( $this, 'etheme_panel_page' ), $icons['etheme_portfolio'], $priorities['etheme_portfolio'] ); } if ( ($is_activated || $allow_full_access) && !$hide_theme_builders ) { // && class_exists('\Elementor\Plugin') // $theme_builder_key = 'et-elementor'. ($has_pro ? '-pro' : '') . '-theme-builder'; $theme_builder_key = 'et-panel-theme-builders'; add_menu_page( sprintf(esc_html__('%s Builders', 'xstore'), $label), sprintf(esc_html__('%s Builders', 'xstore'), $label), 'manage_options', $theme_builder_key, array( $this, 'etheme_panel_page_theme_builders' ), $icons['theme-builders'], $priorities['theme-builders'] ); // if ( $has_pro ) { add_submenu_page( $theme_builder_key, esc_html__('Builders Panel', 'xstore'), esc_html__('Builders Panel', 'xstore'), 'manage_options', $theme_builder_key, array( $this, 'etheme_panel_page_theme_builders' ) ); $theme_builders = array( 'header' => array( 'title' => esc_html__('Header', 'xstore'), 'multiple_builders' => [ 'customizer' => admin_url('/customize.php?autofocus[panel]=header-builder'), 'elementor' => true ], ), 'footer' => array( 'title' => esc_html__('Footer', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ) ); // if ( $allow_force_access_woocommerce_features || $is_wc ) { $theme_builders = array_merge($theme_builders, array( 'product' => array( 'title' => esc_html__('Single Product', 'xstore'), 'multiple_builders' => [ 'customizer' => admin_url('/customize.php?autofocus['.(get_option( 'etheme_single_product_builder', false ) ? 'panel' : 'section').']=single_product_builder'), 'elementor' => true ], ), 'product-archive' => array( 'title' => esc_html__('Products Archive', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ), 'myaccount' => array( 'title' => esc_html__('My Account Page', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ), 'cart' => array( 'title' => esc_html__('Cart Page', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ), 'checkout' => array( 'title' => esc_html__('Checkout Page', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ), 'archive' => array( 'title' => esc_html__('Archive', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ), )); // } $theme_builders = array_merge($theme_builders, array( 'search-results' => array( 'title' => esc_html__('Search Results', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ), 'error-404' => array( 'title' => esc_html__('Error-404', 'xstore'), 'multiple_builders' => [ 'elementor' => true ], ), )); $has_pro = $is_elementor && defined( 'ELEMENTOR_PRO_VERSION' ); $elementor_pro_theme_builder_link = $has_pro ? \Elementor\Plugin::$instance->app->get_settings('menu_url') : ''; foreach ($theme_builders as $theme_builder_unique_key => $theme_builder_unique_info) { $allow_customizer_builder = isset($theme_builder_unique_info['multiple_builders']['customizer']); $allow_elementor_builder = isset($theme_builder_unique_info['multiple_builders']['elementor']); if ( !$is_wc && in_array($theme_builder_unique_key, array('product','product-old', 'product-archive', 'myaccount', 'cart', 'checkout') ) ) $allow_customizer_builder = $allow_elementor_builder = false; $builder_url = admin_url( 'admin.php?page=et-panel-theme-builders' ); $builders_panel_url = admin_url( 'admin.php?page=et-panel-theme-builders' ); // takeover the priority for Customizer builder over other theme builders if ( $allow_customizer_builder ) $builder_url = $theme_builder_unique_info['multiple_builders']['customizer']; // takeover the priority for Elementor builder over other theme builders if ( $allow_elementor_builder ) { if ( in_array($theme_builder_unique_key, array('myaccount', 'cart', 'checkout')) ) { if ($has_pro) { if ( !get_option('et_theme_builder_wc_install_done', false) && method_exists('\WC_Install', 'create_pages') && get_option('etheme_current_version') ) { remove_filter('woocommerce_create_pages', 'etheme_do_not_setup_demo_pages', 10); \WC_Install::create_pages(); // to start this once only on first load update_option('et_theme_builder_wc_install_done', 'yes'); } $cart_checkout_page_id = get_option('woocommerce_' . $theme_builder_unique_key . '_page_id'); // wc_get_page_id($theme_builder_unique_key) not working correct; if ($cart_checkout_page_id > 0) { $builder_url = add_query_arg(array('post' => $cart_checkout_page_id, 'action' => 'elementor', 'et_page' => $theme_builder_unique_key), admin_url('post.php')); } else { // $builder_url = $elementor_pro_theme_builder_link . '/templates/single-page'; $builder_url = add_query_arg(array('post_type' => 'page', 'action' => 'elementor', 'et_page' => $theme_builder_unique_key), admin_url('post-new.php')); } } } else $builder_url = !$has_pro ? $builders_panel_url : $elementor_pro_theme_builder_link . '/templates/' . $theme_builder_unique_key; } add_submenu_page( $theme_builder_key, $theme_builder_unique_info['title'], $theme_builder_unique_info['title'], 'manage_options', $builder_url, '' ); } // } } if ( ($allow_full_access || $is_et_core) && in_array('customize', $show_pages) ) { if ( ($is_activated || $allow_full_access) && $is_et_core ) { add_menu_page( esc_html__('Theme Options', 'xstore'), esc_html__('Theme Options', 'xstore'), 'manage_options', 'et-panel-theme-options', '', $icons['theme-options'], $priorities['theme-options'] ); add_submenu_page( 'et-panel-theme-options', 'Header Builder', 'Header Builder', 'manage_options', admin_url('/customize.php?autofocus[panel]=header-builder'), '' ); } else { add_menu_page( esc_html__('Theme Options', 'xstore'), esc_html__('Theme Options', 'xstore'), 'manage_options', 'et-panel-theme-options', admin_url( 'themes.php?page=install-required-plugins&plugin_status=all' ), $icons['theme-options'], $priorities['theme-options'] ); } } } /** * Add target blank to some dashboard pages. * * @since 6.2 * @version 1.0.0 */ public function et_add_menu_page_target() { ob_start(); ?> page['template']) && ! empty($this->page['template']); ob_start(); get_template_part( 'framework/panel/templates/page', 'header' ); get_template_part( 'framework/panel/templates/page', 'navigation' ); echo '
'; if ($has_template){ get_template_part( 'framework/panel/templates/page', $this->page['template'] ); } echo '
'; get_template_part( 'framework/panel/templates/page', 'footer' ); echo ob_get_clean(); } /** * Show Add admin panel dashboard pages. * * @since 5.0.0 * @version 1.0.4 */ public function etheme_panel_page_theme_builders(){ ob_start(); get_template_part( 'framework/panel/templates/page', 'header', array('theme_builders_page' => true) ); // get_template_part( 'framework/panel/templates/page', 'navigation' ); echo '
'; if (isset($this->page['template']) && ! empty($this->page['template'])){ get_template_part( 'framework/panel/templates/theme-builders/page', $this->page['template'] ); } echo '
'; get_template_part( 'framework/panel/templates/page', 'footer' ); echo ob_get_clean(); } /** * Load content for panel popups * * @since 6.0.0 * @version 1.0.1 * @log 1.0.2 * ADDED: et_ajax_panel_popup header param */ public function et_ajax_panel_popup(){ $response = array(); if ( isset( $_POST['type'] ) ) { if ( in_array($_POST['type'], array('registration', 'deregister', 'remove_content', 'install_theme_builder')) ) { ob_start(); get_template_part( 'framework/panel/templates/popup-theme', $_POST['type']); $response['content'] = ob_get_clean(); } else { ob_start(); get_template_part( 'framework/panel/templates/popup-'.$_POST['type'], 'content' ); $response['content'] = ob_get_clean(); } } else { if (! isset( $_POST['header'] ) || $_POST['header'] !== 'false'){ ob_start(); get_template_part( 'framework/panel/templates/popup-import', 'head' ); $response['head'] = ob_get_clean(); } else { $response['head'] = ''; } ob_start(); get_template_part( 'framework/panel/templates/popup-import', 'content'); $response['content'] = ob_get_clean(); } wp_send_json($response); } /** * Redirect after theme was activated * * @since 6.0.0 * @version 1.0.0 */ public function admin_redirects() { ob_start(); if ( ! get_transient( '_' . $this->theme_name . '_activation_redirect' ) || get_option( 'envato_setup_complete', false ) ) { return; } delete_transient( '_' . $this->theme_name . '_activation_redirect' ); wp_safe_redirect( admin_url( 'admin.php?page=et-panel-welcome' ) ); exit; } public function switch_theme() { set_transient( '_' . $this->theme_name . '_activation_redirect', 1 ); // if ( // ! get_theme_mod( 'header_top_elements', false ) // && ! get_theme_mod( 'header_main_elements', false ) // && ! get_theme_mod( 'header_bottom_elements', false ) // ){ // $ooo = '{"header_top_elements":"{\"element-DWnDe\":{\"size\":\"12\",\"index\":\"1\",\"offset\":\"0\",\"element\":\"promo_text\"}}","header_main_elements":"{\"element-KRycs\":{\"size\":\"2\",\"index\":\"6\",\"offset\":\"0\",\"element\":\"logo\"},\"element-twJZy\":{\"size\":\"5\",\"index\":\"1\",\"offset\":\"0\",\"element\":\"main_menu\"},\"element-LtRTH\":{\"size\":\"5\",\"index\":\"8\",\"offset\":\"0\",\"element\":\"secondary_menu\"}}","header_bottom_elements":"{}","connect_block_package":"[]","options":{"logo_img_et-desktop":{"id":"","url":"","width":"","height":""},"retina_logo_img_et-desktop":{"id":"","url":"","width":"","height":""},"logo_align_et-desktop":"center","logo_width_et-desktop":"140","logo_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"logo_border_et-desktop":"solid","logo_border_color_custom_et-desktop":"","top_header_wide_et-desktop":true,"top_header_height_et-desktop":"30","top_header_fonts_et-desktop":{"text-transform":"none"},"top_header_zoom_et-desktop":"100","top_header_background_et-desktop":{"background-color":"#ffffff","background-image":"","background-repeat":"no-repeat","background-position":"center center","background-size":"","background-attachment":""},"top_header_color_et-desktop":"#000000","top_header_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"top_header_border_et-desktop":"solid","top_header_border_color_custom_et-desktop":"#e1e1e1","main_header_wide_et-desktop":false,"main_header_height_et-desktop":"100","main_header_fonts_et-desktop":{"text-transform":"uppercase","font-backup":"","variant":"regular","font-weight":400,"font-style":"normal"},"main_header_zoom_et-desktop":"100","main_header_background_et-desktop":{"background-color":"#ffffff","background-image":"","background-repeat":"no-repeat","background-position":"center center","background-size":"","background-attachment":""},"main_header_color_et-desktop":"#000000","main_header_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"main_header_border_et-desktop":"solid","main_header_border_color_custom_et-desktop":"#e1e1e1","bottom_header_wide_et-desktop":false,"bottom_header_height_et-desktop":"40","bottom_header_fonts_et-desktop":{"text-transform":"none"},"bottom_header_zoom_et-desktop":"100","bottom_header_background_et-desktop":{"background-color":"#ffffff","background-image":"","background-repeat":"no-repeat","background-position":"center center","background-size":"","background-attachment":""},"bottom_header_color_et-desktop":"#000000","bottom_header_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"bottom_header_border_et-desktop":"solid","bottom_header_border_color_custom_et-desktop":"","top_header_sticky_et-desktop":false,"main_header_sticky_et-desktop":true,"bottom_header_sticky_et-desktop":false,"header_sticky_type_et-desktop":"smart","headers_sticky_animation_et-desktop":"toBottomFull","headers_sticky_animation_duration_et-desktop":0.70000000000000007,"headers_sticky_start_et-desktop":"80","headers_sticky_logo_img_et-desktop":{"id":"","url":"","width":"","height":""},"top_header_sticky_height_et-desktop":"60","top_header_sticky_background_et-desktop":{"background-color":"#ffffff","background-image":"","background-repeat":"no-repeat","background-position":"center center","background-size":"","background-attachment":""},"top_header_sticky_color_et-desktop":"#000000","main_header_sticky_height_et-desktop":"75","main_header_sticky_background_et-desktop":{"background-color":"#ffffff","background-image":"","background-repeat":"no-repeat","background-position":"center center","background-size":"","background-attachment":""},"main_header_sticky_color_et-desktop":"#000000","bottom_header_sticky_height_et-desktop":"60","bottom_header_sticky_background_et-desktop":{"background-color":"#ffffff","background-image":"","background-repeat":"no-repeat","background-position":"center center","background-size":"","background-attachment":""},"bottom_header_sticky_color_et-desktop":"#000000","menu_item_style_et-desktop":"underline","main_menu_term":"53","menu_zoom_et-desktop":"100","menu_alignment_et-desktop":"flex-end","menu_item_fonts_et-desktop":{"font-family":"","variant":"","letter-spacing":"0px","text-transform":"inherit","font-weight":0,"font-style":""},"menu_item_border_radius_et-desktop":"30","menu_item_color_custom_et-desktop":"","menu_item_background_color_custom_et-desktop":"#c62828","menu_item_hover_color_custom_et-desktop":"#888888","menu_item_line_hover_color_custom_et-desktop":"#888888","menu_item_dots_color_custom_et-desktop":"#888888","menu_item_background_hover_color_custom_et-desktop":"","menu_item_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"10px","padding-right":"10px","padding-bottom":"10px","padding-left":"10px"},"menu_nice_space_et-desktop":false,"menu_item_border_color_custom_et-desktop":"","menu_item_border_hover_color_custom_et-desktop":"","menu_2_item_style_et-desktop":"underline","main_menu_2_term":"","menu_2_zoom_et-desktop":"100","menu_2_alignment_et-desktop":"flex-start","menu_2_item_fonts_et-desktop":{"font-family":"","variant":"","letter-spacing":"0px","text-transform":"inherit","font-weight":0,"font-style":""},"menu_2_item_border_radius_et-desktop":"30","menu_2_item_color_custom_et-desktop":"","menu_2_item_background_color_custom_et-desktop":"#c62828","menu_2_item_hover_color_custom_et-desktop":"#888888","menu_2_item_line_hover_color_custom_et-desktop":"#888888","menu_2_item_dots_color_custom_et-desktop":"#888888","menu_2_item_background_hover_color_custom_et-desktop":"","menu_2_item_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"10px","padding-right":"10px","padding-bottom":"10px","padding-left":"10px"},"menu_2_nice_space_et-desktop":false,"menu_2_item_border_color_custom_et-desktop":"","menu_2_item_border_hover_color_custom_et-desktop":"","menu_dropdown_zoom_et-desktop":"110","menu_dropdown_fonts_et-desktop":{"font-family":"","variant":"","letter-spacing":"0px","text-transform":"none","font-weight":0,"font-style":""},"menu_dropdown_background_custom_et-desktop":"#ffffff","menu_dropdown_color_et-desktop":"#000000","menu_dropdown_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"1px","border-right-width":"1px","border-bottom-width":"1px","border-left-width":"1px","padding-top":"1em","padding-right":"2.14em","padding-bottom":"1em","padding-left":"2.14em"},"menu_dropdown_border_et-desktop":"solid","menu_dropdown_border_color_custom_et-desktop":"","secondary_menu_visibility":"on_hover","secondary_menu_home":true,"all_departments_text":"All departments","secondary_menu_term":"","secondary_title_fonts_et-desktop":{"font-family":"","variant":"","letter-spacing":"0px","text-transform":"inherit","font-weight":0,"font-style":""},"secondary_title_background_color_custom_et-desktop":"#c62826","secondary_title_color_et-desktop":"#ffffff","secondary_title_border_radius_et-desktop":"0","secondary_title_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"15px","padding-right":"10px","padding-bottom":"15px","padding-left":"10px"},"secondary_title_border_et-desktop":"solid","secondary_title_border_color_custom_et-desktop":"#e1e1e1","secondary_menu_content_zoom_et-desktop":"100","secondary_menu_content_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"1px","border-bottom-width":"1px","border-left-width":"1px","padding-top":"15px","padding-right":"30px","padding-bottom":"15px","padding-left":"30px"},"secondary_menu_content_border_et-desktop":"solid","secondary_menu_content_border_color_custom_et-desktop":"#e1e1e1","mobile_menu_type_et-desktop":"off_canvas_left","mobile_menu_icon_et-desktop":"icon1","mobile_menu_icon_zoom_et-desktop":1.5,"mobile_menu_label_et-desktop":false,"mobile_menu_text":"Menu","mobile_menu_item_click_et-desktop":false,"mobile_menu_content":["logo","search","menu","wishlist","cart","account","header_socials"],"mobile_menu_2":"categories","mobile_menu_term":"","mobile_menu_logo_type_et-desktop":"simple","mobile_menu_logo_width_et-desktop":"120","mobile_menu_content_alignment_et-desktop":"start","mobile_menu_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"mobile_menu_border_et-desktop":"solid","mobile_menu_border_color_custom_et-desktop":"#e1e1e1","mobile_menu_content_fonts_et-desktop":{"text-transform":"capitalize","font-backup":"","variant":"regular","font-weight":400,"font-style":"normal"},"mobile_menu_zoom_dropdown_et-desktop":"100","mobile_menu_zoom_popup_et-desktop":"100","mobile_menu_overlay_et-desktop":"rgba(0,0,0,.3)","mobile_menu_color2_et-desktop":"#ffffff","mobile_menu_max_height_et-desktop":"500","mobile_menu_background_color_et-desktop":"#ffffff","mobile_menu_color_et-desktop":"#000000","mobile_menu_content_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"10px","padding-right":"10px","padding-bottom":"10px","padding-left":"10px"},"mobile_menu_content_border_et-desktop":"solid","mobile_menu_content_border_color_custom_et-desktop":"#e1e1e1","cart_style_et-desktop":"type1","cart_icon_et-desktop":"type2","cart_icon_zoom_et-desktop":1.3,"cart_label_et-desktop":false,"cart_label_custom":"Cart","cart_total_et-desktop":false,"cart_content_type_et-desktop":"dropdown","mini-cart-items-count":"3","cart_link_to":"cart_url","cart_custom_url":"#","cart_quantity_et-desktop":true,"cart_quantity_size_et-desktop":0.75,"cart_quantity_active_background_custom_et-desktop":"#ffffff","cart_quantity_active_color_et-desktop":"#000000","cart_content_alignment_et-desktop":"end","cart_background_et-desktop":"current","cart_background_custom_et-desktop":"#ffffff","cart_color_et-desktop":"#000000","cart_border_radius_et-desktop":"0","cart_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"cart_border_et-desktop":"solid","cart_border_color_custom_et-desktop":"#e1e1e1","cart_zoom_et-desktop":"100","cart_dropdown_position_et-desktop":"right","cart_dropdown_position_custom_et-desktop":"0","cart_dropdown_background_custom_et-desktop":"#ffffff","cart_dropdown_color_et-desktop":"#000000","cart_content_position_et-desktop":"right","cart_content_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"1px","border-right-width":"1px","border-bottom-width":"1px","border-left-width":"1px","padding-top":"20px","padding-right":"20px","padding-bottom":"20px","padding-left":"20px"},"cart_content_border_et-desktop":"solid","cart_content_border_color_custom_et-desktop":"#e1e1e1","cart_footer_content_et-desktop":"Free shipping over 49$","cart_footer_background_custom_et-desktop":"#f5f5f5","cart_footer_color_et-desktop":"#555555","account_background_et-desktop":"","account_style_et-desktop":"type1","account_icon_et-desktop":"type1","account_icon_zoom_et-desktop":1.3,"account_content_type_et-desktop":"dropdown","account_label_et-desktop":true,"account_label_username":false,"account_text":"Log in \/ Sign in","account_logged_in_text":"My account","account_content_alignment_et-desktop":"start","account_background_custom_et-desktop":null,"account_color_et-desktop":"#ffffff","account_border_radius_et-desktop":"0","account_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"account_border_et-desktop":"solid","account_border_color_custom_et-desktop":"","account_zoom_et-desktop":"100","account_dropdown_position_et-desktop":"right","account_dropdown_position_custom_et-desktop":"0","account_dropdown_background_custom_et-desktop":"#ffffff","account_dropdown_color_et-desktop":"#000000","account_content_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"1px","border-right-width":"1px","border-bottom-width":"1px","border-left-width":"1px","padding-top":"10px","padding-right":"10px","padding-bottom":"10px","padding-left":"10px"},"account_content_border_et-desktop":"solid","account_content_border_color_custom_et-desktop":"#e1e1e1","header_widget1":"","header_widget2":"","html_block1":"","html_block1_sections":false,"html_block1_section":"","html_block2":"","html_block2_sections":false,"html_block2_section":"","html_block3":"","html_block3_sections":false,"html_block3_section":"","promo_text_package":[{"text":"Take 30% off when you spend $120","icon":"et_icon-delivery","icon_position":"before","link_title":"Go shop","link":"#"},{"text":"Free 2-days standard shipping on orders $255+","icon":"et_icon-coupon","icon_position":"before","link_title":"Custom link","link":"#"}],"promo_text_autoplay_et-desktop":true,"promo_text_speed_et-desktop":"3","promo_text_delay_et-desktop":"4","promo_text_navigation_et-desktop":false,"promo_text_close_button_et-desktop":true,"promo_text_close_button_action_et-desktop":false,"promo_text_height_et-desktop":"38","promo_text_background_custom_et-desktop":"#000000","promo_text_color_et-desktop":"#ffffff","button_text_et-desktop":"Button","button_link_et-desktop":"","button_custom_link_et-desktop":"","button_fonts_et-desktop":{"text-transform":"none"},"button_zoom_et-desktop":1,"button_content_align_et-desktop":"start","button_background_custom_et-desktop":"#000000","button_border_radius_et-desktop":"0","button_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"button_border_et-desktop":"solid","button_border_color_custom_et-desktop":"","button_target_et-desktop":false,"button_no_follow_et-desktop":false,"newsletter_shown_on_et-desktop":"click","newsletter_delay_et-desktop":"300","newsletter_icon_et-desktop":"type1","newsletter_label_show_et-desktop":true,"newsletter_label_et-desktop":"Newsletter","newsletter_title_et-desktop":"Title","newsletter_content_et-desktop":"

You can add any HTML here (admin -> Theme Options -> E-Commerce -> Promo Popup).
We suggest you create a static block and use it by turning on the settings below<\/p>","newsletter_sections_et-desktop":false,"newsletter_section_et-desktop":"","newsletter_content_alignment_et-desktop":"start","newsletter_background_et-desktop":{"background-color":"#ffffff","background-image":"","background-repeat":"no-repeat","background-position":"center center","background-size":"","background-attachment":""},"newsletter_background_et-desktop[background-color]":null,"newsletter_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"15px","padding-right":"15px","padding-bottom":"15px","padding-left":"15px"},"newsletter_border_et-desktop":"solid","newsletter_border_color_custom_et-desktop":"","contacts_icon_et-desktop":"left","contacts_direction_et-desktop":"hor","contacts_package_et-desktop":[{"contact_title":"Phone","contact_subtitle":"Call us any time","contact_icon":"et_icon-phone"},{"contact_title":"Hours","contact_subtitle":"Call us any time 24\/7","contact_icon":"et_icon-calendar"},{"contact_title":"Email","contact_subtitle":"Write us any time","contact_icon":"et_icon-chat"}],"contacts_alignment_et-desktop":"start","contact_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"10px","padding-bottom":"10px","padding-left":"10px"},"contact_border_et-desktop":"solid","contact_border_color_custom_et-desktop":"#e1e1e1","header_socials_type_et-desktop":"type1","header_socials_package_et-desktop":[{"social_name":"Facebook","social_url":"#","social_icon":"et_icon-facebook"},{"social_name":"Twitter","social_url":"#","social_icon":"et_icon-twitter"},{"social_name":"Instagram","social_url":"#","social_icon":"et_icon-instagram"},{"social_name":"Google plus","social_url":"#","social_icon":"et_icon-google_plus"},{"social_name":"Youtube","social_url":"#","social_icon":"et_icon-youtube"},{"social_name":"Linkedin","social_url":"#","social_icon":"et_icon-linkedin"}],"header_socials_content_alignment_et-desktop":"start","header_socials_elements_zoom_et-desktop":"100","header_socials_elements_spacing_et-desktop":"10","header_socials_target_et-desktop":false,"header_socials_no_follow_et-desktop":false,"search_type_et-desktop":"input","search_ajax_et-desktop":true,"search_by_sku_et-desktop":true,"search_category_et-desktop":true,"search_all_categories_text_et-desktop":"All categories","search_placeholder_et-desktop":"Search for...","search_limit_results_et-desktop":"3","search_icon_zoom_et-desktop":1,"search_content_alignment_et-desktop":"center","search_width_et-desktop":"100","search_height_et-desktop":"40","search_border_radius_et-desktop":"0","search_color_et-desktop":"#888888","search_button_background_custom_et-desktop":"#000000","search_button_color_et-desktop":"#ffffff","search_input_box_model_et-desktop":{"margin-top":"0px","margin-right":"","margin-bottom":"0px","margin-left":"","border-top-width":"1px","border-right-width":"1px","border-bottom-width":"1px","border-left-width":"1px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"10px"},"search_input_border_et-desktop":"solid","search_input_border_color_custom_et-desktop":"#e1e1e1","search_icon_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"10px","padding-right":"0px","padding-bottom":"10px","padding-left":"0px"},"search_icon_border_et-desktop":"solid","search_icon_border_color_custom_et-desktop":"#e1e1e1","search_zoom_et-desktop":"100","search_content_position_et-desktop":"right","search_content_position_custom_et-desktop":"0","search_content_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"1px","border-right-width":"1px","border-bottom-width":"1px","border-left-width":"1px","padding-top":"20px","padding-right":"30px","padding-bottom":"30px","padding-left":"30px"},"search_content_border_et-desktop":"solid","search_content_border_color_custom_et-desktop":"#e1e1e1","wishlist_style_et-desktop":"type1","wishlist_icon_et-desktop":"type1","wishlist_icon_zoom_et-desktop":1.3,"wishlist_label_et-desktop":true,"wishlist_label_custom_et-desktop":"Wishlist","wishlist_content_type_et-desktop":"dropdown","wishlist_link_to":"wishlist_url","wishlist_custom_url":"#","mini-wishlist-items-count":null,"wishlist_quantity_et-desktop":true,"wishlist_quantity_size_et-desktop":1,"wishlist_quantity_active_background_custom_et-desktop":"#ffffff","wishlist_quantity_active_color_et-desktop":"#000000","wishlist_content_alignment_et-desktop":"start","wishlist_background_et-desktop":"current","wishlist_background_custom_et-desktop":"#ffffff","wishlist_color_et-desktop":"#000000","wishlist_border_radius_et-desktop":"0","wishlist_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"0px","border-right-width":"0px","border-bottom-width":"0px","border-left-width":"0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},"wishlist_border_et-desktop":"solid","wishlist_border_color_custom_et-desktop":"#e1e1e1","wishlist_zoom_et-desktop":"100","wishlist_dropdown_position_et-desktop":"right","wishlist_dropdown_position_custom_et-desktop":"0","wishlist_dropdown_background_custom_et-desktop":"#ffffff","wishlist_content_position_et-desktop":"right","wishlist_content_box_model_et-desktop":{"margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px","border-top-width":"1px","border-right-width":"1px","border-bottom-width":"1px","border-left-width":"1px","padding-top":"20px","padding-right":"20px","padding-bottom":"20px","padding-left":"20px"},"wishlist_content_border_et-desktop":"solid","wishlist_content_border_color_custom_et-desktop":"#e1e1e1"}}'; // $ooo = json_decode($ooo, true); // foreach ( $ooo as $key => $val ) { // set_theme_mod( $key, $val ); // } // } } // Stas fields public $xstore_panel_section_settings, $settings_name; public function enqueue_settings_scripts($script) { if ( $script == 'icons_select' ) { $this->xstore_panel_icons_fonts_enqueue(); } wp_register_script('etheme_panel_'.$script, ETHEME_BASE_URI.'framework/panel/js/settings/'.$script.'.js', array('jquery','etheme_admin_js'), false,true); wp_enqueue_script('etheme_panel_'.$script); wp_localize_script( 'xstore_panel_settings_'.$script, 'XStorePanelSettings'.ucfirst($script).'Config', $this->settingJsConfig ); } public function xstore_panel_icons_list($type = 'simple') { $icons = array( 'simple' => array( 'none' => esc_html__( 'None', 'xstore' ), 'et_icon-delivery' => esc_html__( 'Delivery', 'xstore' ), 'et_icon-coupon' => esc_html__( 'Coupon', 'xstore' ), 'et_icon-calendar' => esc_html__( 'Calendar', 'xstore' ), 'et_icon-compare' => esc_html__( 'Compare', 'xstore' ), 'et_icon-checked' => esc_html__( 'Checked', 'xstore' ), 'et_icon-tick' => esc_html__( 'Tick', 'xstore' ), 'et_icon-chat' => esc_html__( 'Chat', 'xstore' ), 'et_icon-phone-call' => esc_html__( 'Phone', 'xstore' ), 'et_icon-whatsapp' => esc_html__( 'Whatsapp', 'xstore' ), 'et_icon-viber' => esc_html__( 'Viber', 'xstore' ), 'et_icon-exclamation' => esc_html__( 'Exclamation', 'xstore' ), 'et_icon-gift' => esc_html__( 'Gift', 'xstore' ), 'et_icon-heart' => esc_html__( 'Heart', 'xstore' ), 'et_icon-heart-2' => esc_html__( 'Heart 2', 'xstore' ), 'et_icon-message' => esc_html__( 'Message', 'xstore' ), 'et_icon-internet' => esc_html__( 'Internet', 'xstore' ), 'et_icon-user' => esc_html__( 'Account', 'xstore' ), 'et_icon-sent' => esc_html__( 'Sent', 'xstore' ), 'et_icon-home' => esc_html__( 'Home', 'xstore' ), 'et_icon-shop' => esc_html__( 'Shop', 'xstore' ), 'et_icon-shopping-bag' => esc_html__( 'Bag', 'xstore' ), 'et_icon-shopping-bag-2' => esc_html__( 'Bag 2', 'xstore' ), 'et_icon-shopping-bag-3' => esc_html__( 'Bag 3', 'xstore' ), 'et_icon-shopping-cart' => esc_html__( 'Cart', 'xstore' ), 'et_icon-shopping-cart-2' => esc_html__( 'Cart 2', 'xstore' ), 'et_icon-shopping-basket' => esc_html__( 'Basket', 'xstore' ), 'et_icon-burger' => esc_html__( 'Burger', 'xstore' ), 'et_icon-star' => esc_html__( 'Star', 'xstore' ), 'et_icon-time' => esc_html__( 'Time', 'xstore' ), 'et_icon-location' => esc_html__( 'Location', 'xstore' ), 'et_icon-dev-menu' => esc_html__( 'Dev menu', 'xstore' ), 'et_icon-clock' => esc_html__( 'clock', 'xstore' ), 'et_icon-size' => esc_html__( 'Size', 'xstore' ), 'et_icon-more' => esc_html__( 'More', 'xstore' ), ), ); return $icons[$type]; } // don't name setting with key of elements it will break saving for this field public function xstore_panel_settings_repeater_field( $section = '', $setting = '', $setting_title = '', $setting_descr = '', $default = '', $template = array(), $active_callbacks = array(), $custom_item_title = false ) { wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-ui-draggable'); $this->enqueue_settings_scripts( 'sortable' ); $this->enqueue_settings_scripts( 'repeater' ); $settings = $this->xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $selected_value = $settings[ $section ][ $setting ]; } else { $selected_value = $default; } $values_2_save = $selected_value; if ( is_array( $selected_value ) ) { $values_2_save = array(); foreach ( $selected_value as $item_value => $item_name ) { $values_2_save[] = $item_value; } $values_2_save = implode( ',', $values_2_save ); } $sorted_list_parsed = array(); if ( ! empty( $values_2_save ) ) { $sorted_list_values = explode( ',', $values_2_save ); foreach ( $sorted_list_values as $item ) { $sorted_list_parsed[ $item ] = array( 'callbacks' => $template ); // foreach ( $template as $template_item => $template_item_value) { // $current_template = $template; // $current_template[$template_item]['args'][1] = $item.'_'.$template_item_value['args'][1]; // $sorted_list_parsed[$item] = array( // 'callbacks' => $template // ); // } } } // foreach ($sorted_list_values as $item) { // $sorted_list_parsed[$item] = $default[$item]; // } if ( count($sorted_list_parsed)) $sorted_list_parsed = array_merge($sorted_list_parsed, $default); $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>

>

:

$item_name) { $i++;?>

enqueue_settings_scripts('sortable'); $settings = $this->xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $selected_value = $settings[ $section ][ $setting ]; } else { $selected_value = $default; } $values_2_save = $selected_value; if ( is_array($selected_value)) { $values_2_save = array(); foreach ( $selected_value as $item_value => $item_name ) { $values_2_save[] = $item_value; } $values_2_save = implode(',', $values_2_save); } $sorted_list_parsed = array(); $sorted_list_values = explode(',', $values_2_save); foreach ($sorted_list_values as $item) { if ( !isset($default[$item])) continue; $sorted_list_parsed[$item] = $default[$item]; } $sorted_list_parsed = array_merge($sorted_list_parsed, $default); $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>
>

:

$item_name) { if ( !$item_name['name'] ) continue; $with_options = isset($item_name['callbacks']); $visibility_setting_name = $item_value . '_visibility'; if ( isset($settings[ $section ]) ) { if ( isset( $settings[ $section ][ $visibility_setting_name ] ) && $settings[ $section ][ $visibility_setting_name ] ) { $visibility_setting_value = true; } else { $visibility_setting_value = false; } } else { $visibility_setting_value = isset($item_name['visible']) ? $item_name['visible'] : true; } ?>

>

enqueue_settings_scripts('colorpicker'); $settings = $this->xstore_panel_section_settings; ob_start(); ?>

:

data-default="" data-css-var=""/>
enqueue_settings_scripts('media'); $settings = $this->xstore_panel_section_settings; ob_start(); ?>

:

'; } ?>
data-js-selector="" data-js-img-var="" />
enqueue_settings_scripts('switch'); $settings = $this->xstore_panel_section_settings; // $value = $settings[ $section ][ $setting ] ?? $default; // $value = $value === 'no' ? false : $value; if ( isset($settings[ $section ]) ) { if ( isset( $settings[ $section ][ $setting ] ) && $settings[ $section ][ $setting ] == 'on' ) { $value = true; } else { $value = false; } } else { $value = $default; } $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>
>
'. $setting_title . ':'; ?> '. $setting_descr . '

'; endif; ?>
xstore_panel_section_settings; $class = ''; $to_hide = false; $attr = array(); if ( count( $active_callbacks ) ) { $this->enqueue_settings_scripts( 'callbacks' ); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key ) { if ( isset( $settings[ $key['section'] ] ) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'] . ':' . $key['value']; } $attr[] = 'data-callbacks="' . implode( ',', $attr['data-callbacks'] ) . '"'; unset( $attr['data-callbacks'] ); } if ( $to_hide ) { $class .= ' hidden'; } // fix for white label prefix of elements $element_prefix = $this->settings_name == 'xstore_white_label_branding_settings' ? 'page' : $section; ob_start(); ?>
>

:

$val ) { $key_origin = $key; $key = $element_prefix . '_' . $key; ?>
xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $selected_value = $settings[ $section ][ $setting ]; } else { $selected_value = $default; } $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>
>

:

' . $setting_descr . '

'; endif; ?>
enqueue_settings_scripts('icons_select'); $settings = $this->xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $selected_value = $settings[ $section ][ $setting ]; } else { $selected_value = $default; } ob_start(); ?>

:

enqueue_settings_scripts('slider'); $settings = $this->xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $value = $settings[ $section ][ $setting ]; } else { $value = $default; } $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>
>

:

data-postfix="" >
name of option to compare, * 'value' => value of option to compare, * 'section' => section of option to compare, * 'default' => default value of option for backward compatibility then * * @return void * * @since 1.0.0 * */ public function xstore_panel_settings_tab_field_start($title, $active_callbacks = array()) { $this->enqueue_settings_scripts('tab'); $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ?>
> ' . $title; ?> '; ?>
xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $value = $settings[ $section ][ $setting ]; } else { $value = $default; } $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>
>

:

xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $value = $settings[ $section ][ $setting ]; } else { $value = $default; } $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>
>

:

' . $setting_descr . '

'; endif; ?>
data-js-selector="" >
xstore_panel_section_settings; $class = ''; $to_hide = false; $attr = array(); if ( count($active_callbacks) ) { $this->enqueue_settings_scripts('callbacks'); $attr['data-callbacks'] = array(); foreach ( $active_callbacks as $key) { if ( isset($settings[ $key['section'] ]) ) { if ( isset( $settings[ $key['section'] ][ $key['name'] ] ) && $settings[ $key['section'] ][ $key['name'] ] == $key['value'] ) { } else { $to_hide = true; } } elseif ( $key['value'] != $key['default'] ) { $to_hide = true; } $attr['data-callbacks'][] = $key['name'].':'.$key['value']; } $attr[] = 'data-callbacks="'. implode(',', $attr['data-callbacks']) . '"'; unset($attr['data-callbacks']); } if ( $to_hide ) { $class .= ' hidden'; } ob_start(); ?>
>

:

xstore_panel_section_settings; if ( isset( $settings[ $section ][ $setting ] ) ) { $value = $settings[ $section ][ $setting ]; } else { $value = $default; } ob_start(); ?>

:

' . $setting_descr . '

'; endif; ?>
settings_name; if ( ! isset( $_POST['_nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['_nonce'] ), 'xstore_panel_saving_nonce' ) || !in_array($settings_name, array('xstore_amp_settings', 'xstore_sales_booster_settings', 'xstore_white_label_branding_settings')) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, it's used only for nonce verification wp_send_json(array( 'success' => false, 'msg' => '

' . __( 'You are not allowed to complete this task due to invalid nonce validation.', 'xstore' ) . '

', 'icon' => 'error icon

', )); exit; } $all_settings = (array)get_option( $settings_name, array() ); $local_settings = isset( $_POST['settings'] ) ? $_POST['settings'] : array(); if ( isset( $_POST['type'] ) ) { $local_settings_key = $_POST['type']; } else { switch ( $settings_name ) { case 'xstore_sales_booster_settings': $local_settings_key = 'fake_sale_popup'; break; default: $local_settings_key = 'general'; } } $updated = false; $local_settings_parsed = array(); foreach ( $local_settings as $setting ) { // $local_settings_parsed[ $local_settings_key ][ $setting['name'] ] = $setting['value']; // if ( $this->settings_name == 'xstore_sales_booster_settings' ) $local_settings_parsed[ $local_settings_key ][ $setting['name'] ] = stripslashes( $setting['value'] ); } $all_settings = array_merge( $all_settings, $local_settings_parsed ); update_option( $settings_name, $all_settings ); $updated = true; switch ($local_settings_key) { case 'fake_sale_popup': delete_transient('etheme_'.$local_settings_key.'_products_rendered'); delete_transient('etheme_'.$local_settings_key.'_orders_rendered'); break; case 'fake_live_viewing': case 'fake_product_sales': $product_ids = (array)get_transient('etheme_'.$local_settings_key.'_ids', array()); if ( count($product_ids) ) { foreach ($product_ids as $product_id) { if ( $product_id ) delete_transient('etheme_'.$local_settings_key.'_' . $product_id); } } break; } wp_send_json(array( 'success' => !!$updated, 'msg' => '

' . ( ( $updated ) ? esc_html__( 'Settings successfully saved!', 'xstore' ) : esc_html__( 'Settings saving error!', 'xstore' ) ) . '

', 'icon' => ( $updated ) ? 'installed icon

' : '', )); } public function et_close_installation_video(){ check_ajax_referer('etheme_installation_video', 'security'); if (!current_user_can( 'manage_options' )){ wp_send_json(array('result'=> 'error')); } add_option('et_close_installation_video', true, '', false); wp_send_json(array('result'=> 'success')); } public function get_filters_form($filters_list = array(), $extra_settings = array()) { $settings = array( 'type' => '', 'title' => true, 'custom_title' => false, 'icon' => true, 'custom_class' => '', 'tag' => 'span', 'arrow' => false, 'custom_icon' => false, 'on_hover' => true, 'ghost_filters' => false // if needed only design of filters but not the work of them ); $settings = wp_parse_args( $extra_settings, $settings ); $active_key = !$settings['ghost_filters'] ? array_key_first($filters_list) : ''; $classes = array(); $classes[] = !empty($settings['custom_class']) ? $settings['custom_class'] . ' ' . 'et-filter-toggle-ghost' : 'et-filter-toggle'; if ( !$settings['on_hover'] ) $classes[] = 'et-filters-on-click'; if (!$settings['title']) $classes[] = 'et-filter-toggle-icon'; ?> 1%'; ?>

search

'); ?>

'.$feedback_text.'

'; ?>

main_construct();