/** * Returns single instance of the class * * @since 1.0.0 */ public static function get_instance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
/** * Add a panel under YITH Plugins tab * * @return void * @since 1.0 * @author Andrea Grillo <*****@*****.**> * @use /Yit_Plugin_Panel class * @see plugin-fw/lib/yit-plugin-panel.php */ public function register_panel() { if (!empty($this->_panel)) { return; } $admin_tabs['general'] = __('General', 'ywzm'); if (!defined('YITH_YWZM_PREMIUM')) { $admin_tabs['premium-landing'] = __('Premium Version', 'ywzm'); } else { $admin_tabs['exclusions'] = __('Product exclusion list', 'ywzm'); } $args = array('create_menu_page' => true, 'parent_slug' => '', 'page_title' => 'Zoom magnifier', 'menu_title' => 'Zoom magnifier', 'capability' => 'manage_options', 'parent' => '', 'parent_page' => 'yit_plugin_panel', 'page' => $this->_panel_page, 'admin-tabs' => $admin_tabs, 'options-path' => YITH_YWZM_DIR . '/plugin-options'); /* === Fixed: not updated theme === */ if (!class_exists('YIT_Plugin_Panel_WooCommerce')) { require_once 'plugin-fw/lib/yit-plugin-panel-wc.php'; } $this->_panel = new YIT_Plugin_Panel_WooCommerce($args); /** Add custom types actions and filters */ YITH_YWZM_Custom_Types::get_instance(); }