id : ''; $xstore_branding_settings = get_option( 'xstore_white_label_branding_settings', array() ); wp_register_style('etheme_admin_panel_css', ETHEME_CODE_CSS.'et_admin-panel-styles.css'); wp_register_style('etheme_admin_panel_options_css', ETHEME_CODE_CSS.'et_admin-panel-options.css'); if ( defined('ET_CORE_VERSION')) wp_register_style('et-core-eight_theme-elementor-icon', ET_CORE_URL . 'app/assets/css/eight_theme-elementor-icon.css'); wp_register_style('etheme_admin_panel_theme_builders_css', ETHEME_CODE_CSS.'et_admin-panel-theme-builders.css'); if ( strpos($screen_id, 'et-panel') ) { wp_enqueue_script('etheme_panel_global'); wp_enqueue_style('etheme_admin_panel_css'); if ( strpos($screen_id, 'et-panel-sales-booster') || strpos($screen_id, 'et-panel-white-label-branding') || strpos($screen_id, 'et-panel-xstore-amp') ) { wp_enqueue_style('etheme_admin_panel_options_css'); } if ( strpos($screen_id, 'et-panel-theme-builders') ) { wp_enqueue_style('etheme_admin_panel_theme_builders_css'); } else { // xstore icons needed only for menu in non-theme-builder page wp_enqueue_style('xstore-panel-nav-icons', ETHEME_CODE_CSS.'xstore-panel-nav-icons.css'); } if ( count($xstore_branding_settings) ) { if ( isset($xstore_branding_settings['control_panel']) ) { $colors = array(); $colors_output = array(); foreach ($xstore_branding_settings['control_panel'] as $color => $color_val) { if ( strpos($color, '_color') !== false && $color_val ) { $colors['--et_admin_' . str_replace('_', '-', $color)] = $color_val; } } $styles = array(); foreach ($colors as $color_key => $color_val) { $colors_output[] = $color_key . ':' . $color_val . ' !important'; if ( $color_key == '--et_admin_main-color' ) { $styles[] = '.etheme-page-header {background-color: '.$color_val.';}'; } } if ( count($colors_output)) $styles[] = ':root {'.implode(';', $colors_output) . '}'; if ( count($styles) ) { wp_add_inline_style('etheme_admin_panel_css', implode(' ', $styles)); } } } } wp_enqueue_style('farbtastic'); wp_enqueue_style('etheme_admin_css', ETHEME_CODE_CSS.'etheme_admin_backend-styles.css'); if ( is_rtl() ) { wp_enqueue_style('etheme_admin_rtl_css', ETHEME_CODE_CSS.'etheme_admin_backend-styles-rtl.css'); } wp_register_style("etheme_font-awesome", get_template_directory_uri().'/css/fontawesome/4.7.0/font-awesome.min.css'); if ( count($xstore_branding_settings) ) { if ( isset($xstore_branding_settings['control_panel']) && $xstore_branding_settings['control_panel']['icon'] ) { wp_add_inline_style('etheme_admin_css', ':root {--et-shortcodes-icon: url("'. $xstore_branding_settings['control_panel']['icon'] . '");}'); } if ( isset($xstore_branding_settings['advanced']) ) { wp_add_inline_style('etheme_admin_css', $xstore_branding_settings['advanced']['admin_css']); } } if ( $pagenow == 'widgets.php' || strpos($screen_id, 'widgets' ) ) { $widgets_label_styles_selectors = [ 'div[id*=_et_]:before', 'div[id*=_etheme]:before', 'div[id*=null-instagram-feed]:before' ]; $widgets_label_styles = implode(', ', $widgets_label_styles_selectors) . ' { content: "'.apply_filters('etheme_theme_label', 'XStore').'"; position: absolute; bottom: calc(100% - 10px); background: var(--et_admin_dark-color); color: #fff; font-size: 0.65em; line-height: 1; padding: 4px 5px; border-radius: 3px; }'; // $widgets_label_styles .= implode(', ', str_replace(':before', ':hover:before', $widgets_label_styles_selectors)) . '{ // opacity: 0; // visibility: hidden; // }'; $widgets_all_label_styles_selectors = []; foreach ($widgets_label_styles_selectors as $widgets_label_styles_selector) { $widgets_all_label_styles_selectors[] = '.widgets-holder-wrap ' . $widgets_label_styles_selector . ' .widget-title'; } $widgets_label_styles .= implode(', ', str_replace(':before', '', $widgets_all_label_styles_selectors)) . '{ text-indent: -73px; }'; wp_add_inline_style('etheme_admin_css', $widgets_label_styles); } // Variations Gallery Images script switch ($screen_id) { case 'elementor_page_elementor-element-manager': wp_enqueue_style('et-core-eight_theme-elementor-icon'); break; case 'product': case 'edit-product': if (etheme_get_option('enable_variation_gallery', 0) ) { wp_enqueue_script('etheme_admin_product_variations_js', ETHEME_CODE_JS.'product-variations.js', array('etheme_admin_js', 'wc-admin-product-meta-boxes', 'wc-admin-variation-meta-boxes'), false,true); } break; case 'product_page_product_attributes': // add more description for product_attributes slug $product_attributes_notice = esc_html__('Please use only Latin characters, numbers, and symbols such as "-" or "_".', 'xstore'); wp_add_inline_script( 'etheme_admin_js', " jQuery(document).ready(function($) { $('#attribute_name').after('

".$product_attributes_notice."

'); });", 'after' ); break; } } } if(!function_exists('etheme_add_admin_script')) { add_action('admin_init','etheme_add_admin_script', 1130); function etheme_add_admin_script(){ global $pagenow; add_thickbox(); wp_enqueue_script('theme-preview'); wp_enqueue_script('common'); wp_enqueue_script('wp-lists'); // wp_enqueue_script('postbox'); wp_enqueue_script('farbtastic'); // wp_enqueue_script('et_masonry', get_template_directory_uri().'/js/jquery.masonry.min.js',array(),false,true); wp_register_script( 'jquery_lazyload', ETHEME_BASE_URI . '/js/libs/jquery.lazyload.js', array('jquery') ); wp_enqueue_script('etheme_admin_js', ETHEME_CODE_JS.'admin-scripts.min.js', array(), false,true); $localize_admin_script = array( 'choose_image' => esc_html__( 'Choose Image', 'xstore' ), 'theme_label' => apply_filters('etheme_theme_label', 'XStore'), 'add_image' => esc_html__( 'Add Images', 'xstore' ), 'menu_enabled' => etheme_get_option('et_menu_options', 1), 'plugins' => array( 'et_core_plugin' => class_exists('ETC\App\Controllers\Admin\Import'), 'woocommerce' => class_exists('WooCommerce'), 'elementor' => defined( 'ELEMENTOR_VERSION' ), ), 'icons' => array( 'loader' => ' ', 'close' => ' ' ), 'messages' => array( 'skip_import' => esc_html__('Your import process will be lost if you navigate away from this page.', 'xstore'), 'skip_process' => esc_html__('Are you sure? Your delete process will be lost if you leave this page.', 'xstore') ), 'wp_customize_url' => wp_customize_url() ); if ( class_exists('\Elementor\Plugin') && defined( 'ELEMENTOR_PRO_VERSION' ) ) { $localize_admin_script['elementor_theme_builder_url'] = \Elementor\Plugin::$instance->app->get_settings('menu_url'); } wp_localize_script( 'etheme_admin_js', 'et_variation_gallery_admin', apply_filters('etheme_admin_js_localize', $localize_admin_script) ); } } add_action('init', 'etheme_white_label_filters', -999); function etheme_white_label_filters () { $xstore_branding_settings = get_option( 'xstore_white_label_branding_settings', array() ); if ( count($xstore_branding_settings) ) { $theme = wp_get_theme(); $xstore_branding_settings['theme_template'] = $theme->template; if ( isset($xstore_branding_settings['advanced']) ) { add_filter( 'wp_prepare_themes_for_js', function($themes) use ($xstore_branding_settings){ if ( isset($xstore_branding_settings['advanced']['screenshot']) && $xstore_branding_settings['advanced']['screenshot'] ) $themes[$xstore_branding_settings['theme_template']]['screenshot'][0] = $xstore_branding_settings['advanced']['screenshot']; if ( isset($xstore_branding_settings['advanced']['theme_name']) && $xstore_branding_settings['advanced']['theme_name'] ) $themes[$xstore_branding_settings['theme_template']]['name'] = $xstore_branding_settings['advanced']['theme_name']; if ( isset($xstore_branding_settings['advanced']['theme_description']) && $xstore_branding_settings['advanced']['theme_description'] ) $themes[$xstore_branding_settings['theme_template']]['description'] = $xstore_branding_settings['advanced']['theme_description']; return $themes; } ); } if ( isset($xstore_branding_settings['control_panel']) ) { if ( $xstore_branding_settings['control_panel']['label'] ) { $theme_label = $xstore_branding_settings['control_panel']['label']; add_filter('etheme_theme_label', function ($label) use ($theme_label) { return $theme_label;}); } if ( isset($xstore_branding_settings['control_panel']['hide_updates']) && $xstore_branding_settings['control_panel']['hide_updates'] == 'on' ) { add_filter('etheme_hide_updates', '__return_true'); } add_filter( 'wp_prepare_themes_for_js', function($themes) use ($xstore_branding_settings){ if ( $xstore_branding_settings['control_panel']['theme_version'] ) { $themes[$xstore_branding_settings['theme_template']]['version'] = $xstore_branding_settings['control_panel']['theme_version']; } return $themes; }); } if ( isset($xstore_branding_settings['plugins_data'])) { add_filter( 'wp_prepare_themes_for_js', function($themes) use ($xstore_branding_settings){ if ( isset($xstore_branding_settings['plugins_data']['author']) && !empty($xstore_branding_settings['plugins_data']['author'] ) ) { $themes[$xstore_branding_settings['theme_template']]['author'] = $xstore_branding_settings['plugins_data']['author']; // replace author name placed inside link $themes[$xstore_branding_settings['theme_template']]['authorAndUri'] = str_replace('>8theme<', '>'.$xstore_branding_settings['plugins_data']['author'].'<', $themes[$xstore_branding_settings['theme_template']]['authorAndUri']); } if ( isset($xstore_branding_settings['plugins_data']['author_uri']) && !empty($xstore_branding_settings['plugins_data']['author_uri'] ) ) $themes[$xstore_branding_settings['theme_template']]['authorAndUri'] = ''.$themes[$xstore_branding_settings['theme_template']]['author'].''; return $themes; } ); if ( isset($xstore_branding_settings['plugins_data']['author']) && !empty($xstore_branding_settings['plugins_data']['author'] ) ) { $author_name = $xstore_branding_settings['plugins_data']['author']; add_filter('etheme_theme_author_name', function ($author) use ($author_name) { return $author_name;}); } if ( isset($xstore_branding_settings['plugins_data']['documentation_url']) && !empty($xstore_branding_settings['plugins_data']['documentation_url'] ) ) { $documentation_url = $xstore_branding_settings['plugins_data']['documentation_url']; add_filter('etheme_documentation_url', function ($url) use ($documentation_url) { return $documentation_url; }); } if ( isset($xstore_branding_settings['plugins_data']['support_url']) && !empty($xstore_branding_settings['plugins_data']['support_url'] ) ) { $support_url = $xstore_branding_settings['plugins_data']['support_url']; add_filter('etheme_support_forum_url', function ($url) use ($support_url) { return $support_url; }); } } } } add_action('wp_ajax_et_ajax_required_plugins_popup', 'et_ajax_required_plugins_popup'); if ( !function_exists('et_ajax_required_plugins_popup') ) { function et_ajax_required_plugins_popup() { $response = array(); ob_start(); get_template_part( 'framework/panel/templates/popup-theme', $_POST['type']); $response['content'] = ob_get_clean(); wp_send_json($response); } } add_action( 'wp_ajax_et_update_menu_ajax', 'et_update_menu_ajax' ); if ( ! function_exists('et_update_menu_ajax')) { function et_update_menu_ajax () { check_ajax_referer('etheme_update-menu-item', 'security'); if (!current_user_can( 'manage_options' )){ wp_send_json_error('Unauthorized access'); } $post = $_POST['item_menu']; // update_post_meta( $post['db_id'], '_menu-item-disable_titles', $post['dis_titles']); update_post_meta( $post['db_id'], '_menu-item-anchor', sanitize_post($post['anchor'])); update_post_meta( $post['db_id'], '_menu-item-design', sanitize_post($post['design'])); update_post_meta( $post['db_id'], '_menu-item-design2', sanitize_post($post['design2'])); update_post_meta( $post['db_id'], '_menu-item-column_width', $post['column_width']); update_post_meta( $post['db_id'], '_menu-item-column_height', $post['column_height']); update_post_meta( $post['db_id'], '_menu-item-sublist_width', $post['sublist_width']); update_post_meta( $post['db_id'], '_menu-item-columns', $post['columns']); update_post_meta( $post['db_id'], '_menu-item-icon_type', sanitize_post($post['icon_type'])); update_post_meta( $post['db_id'], '_menu-item-icon', $post['icon']); update_post_meta( $post['db_id'], '_menu-item-label', sanitize_post($post['item_label'])); update_post_meta( $post['db_id'], '_menu-item-background_repeat', sanitize_post($post['background_repeat'])); update_post_meta( $post['db_id'], '_menu-item-background_position', $post['background_position']); update_post_meta( $post['db_id'], '_menu-item-use_img', sanitize_post($post['use_img'])); update_post_meta( $post['db_id'], '_menu-item-widget_area', sanitize_post($post['widget_area'])); update_post_meta( $post['db_id'], '_menu-item-static_block', sanitize_post($post['static_block'])); echo json_encode($post); die(); } } add_action( 'admin_footer', 'admin_template_js' ); function admin_template_js() { if ( !etheme_get_option('enable_variation_gallery', 0) ) {return;} ob_start(); ?> ID ); $gallery_images = get_post_meta( $variation_id, 'et_variation_gallery_images', true ); if ( !(bool)$gallery_images) { // Compatibility with WooCommerce Additional Variation Images plugin $gallery_images = get_post_meta($variation_id, '_wc_additional_variation_images', true); if ( (bool)$gallery_images ) $gallery_images = array_filter( explode( ',', $gallery_images ) ); } ?>
"_et_product_variation_title[$loop]", 'label' => __( 'Custom variation title', 'xstore' ), 'type' => 'text', 'value' => get_post_meta( $variation->ID, '_et_product_variation_title', true ) ) ); ?>