/** * @copydoc ThemePlugin::isActive() */ public function isActive() { if (defined('SESSION_DISABLE_INIT')) { return true; } return parent::isActive(); }
function isWooCommercePost() { if (!ThemePlugin::isActive('woocommerce/woocommerce.php')) { return false; } if (!function_exists('is_woocommerce')) { return false; } return is_woocommerce() || is_cart() || is_checkout() || is_account_page(); }
function publicInit() { require_once ABSPATH . 'wp-admin/includes/plugin.php'; $this->prepareLibrary(); $GoogleFont = new ThemeGoogleFont(); $GoogleFont->setToStyle($this->library['style']); $this->includeLibrary(ThemeOption::getOption('responsive_mode_enable'), null, array('responsive')); $this->includeLibrary(ThemeOption::getOption('responsive_mode_enable') && is_rtl(), null, array('responsive-rtl')); $this->includeLibrary(!ThemeOption::getOption('responsive_mode_enable'), null, array('responsive-disable')); $this->includeLibrary(is_rtl(), null, array('jquery-themeOption-rtl', 'jquery-dropkick-rtl', 'widget-rtl', 'pb-component-menu-rtl')); $this->includeLibrary(ThemePlugin::isActive('timetable/timetable.php'), null, array('theme-timetable')); $this->includeLibrary(ThemePlugin::isActive('woocommerce/woocommerce.php'), null, array('theme-woocommerce')); $this->includeLibrary(ThemePlugin::isActive('woocommerce/woocommerce.php') && is_rtl(), null, array('theme-woocommerce-core-rtl')); $this->includeLibrary(ThemePlugin::isActive('woocommerce/woocommerce.php') && is_rtl(), null, array('theme-woocommerce-rtl')); $this->includeLibrary(!class_exists('TSThemeStyle'), null, array('ts-frontend')); $this->includeLibrary(!class_exists('PBPageBuilder'), null, array('pb-frontend', 'pb-frontend-main')); $this->includeLibrary(!class_exists('PBPageBuilder') && is_rtl(), null, array('pb-frontend-main-rtl')); $this->addLibrary('style', 2); $this->addLibrary('script', 2); $aPattern = array('rightClick' => '/^right_click_/', 'selection' => '/^copy_selection_/', 'fancyboxImage' => '/^fancybox_image_/', 'fancyboxVideo' => '/^fancybox_video_/', 'goToPageTop' => '/^go_to_page_top_/'); $option = ThemeOption::getOptionObject(); foreach ($aPattern as $indexPattern => $valuePattern) { foreach ($option as $index => $value) { if (preg_match($valuePattern, $index, $result)) { $nIndex = preg_replace($valuePattern, '', $index); $data[$indexPattern][$nIndex] = $value; } } } $data['config']['theme_url'] = THEME_URL; $data['config']['is_rtl'] = is_rtl() ? 1 : 0; $data['config']['woocommerce_enable'] = (int) ThemePlugin::isActive('woocommerce/woocommerce.php'); $param = array('l10n_print_after' => 'themeOption=' . json_encode($data) . ';'); wp_localize_script('public', 'themeOption', $param); }