/** * Output the settings */ public function output() { global $current_section; $GLOBALS['hide_save_button'] = true; $settings = $this->get_settings($current_section); BE_Compare_Settings::output_fields($settings); if ($current_section == '') { $this->show_table_categories(); } elseif ($current_section == 'manage-features') { $this->show_table_features(); } }
/** * Include the settings page classes */ public static function get_settings_pages() { if (empty(self::$settings)) { $settings = array(); include_once WC()->plugin_path() . '/includes/admin/settings/class-wc-settings-page.php'; $settings[] = (include 'class-settings-general.php'); $settings[] = (include 'class-settings-categories.php'); $settings[] = (include 'class-settings-products.php'); $settings[] = (include 'class-settings-shortcodes.php'); self::$settings = apply_filters('be_compare_settings_pages', $settings); } return self::$settings; }
/** * ������� ������������ */ function new_product_tab($tabs) { global $post; $tab_enabled = BE_Compare_Settings::get_option('be_compare_features_enabled'); $product_enabled = get_post_meta($post->ID, 'enable_compare_product', true); if ($tab_enabled == 'yes' && $product_enabled == 'yes') { // determine tab's position switch (sanitize_title(BE_Compare_Settings::get_option('be_compare_features_location'))) { case 'before-desc': $hook_index = 5; break; case 'before-additional': $hook_index = 15; break; case 'before-reviews': $hook_index = 25; break; case 'after-reviews': default: $hook_index = 35; break; } // Adds the new tab $tabs['features'] = array('title' => __(BE_Compare_Settings::get_option('be_compare_features_title'), 'be-compare-products'), 'priority' => $hook_index, 'callback' => array($this, 'new_product_tab_content')); } return $tabs; }
/** * initialize settings page content */ public function display_settings() { include_once WC()->plugin_path() . '/includes/admin/class-wc-admin-settings.php'; include_once 'inc/class-settings.php'; BE_Compare_Settings::output(); }