public function __construct() { $this->init(); $plugin = Welcart2::get_instance(); $this->plugin_slug = $plugin->get_plugin_slug(); $admin = WC2_Admin::get_instance(); $this->menu_slug = $admin->get_toplevel_menu_slug(); $this->clear_action_status(); /*******************************************/ add_action('admin_head', array($this, 'add_admin_head')); // Load admin style sheet and JavaScript. add_action('admin_print_styles', array($this, 'enqueue_admin_styles')); add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts')); // Add the options page and menu item. add_action('admin_menu', array($this, 'add_admin_menu')); //スクリーン自体の表示・非表示 add_filter('screen_options_show_screen', array($this, 'admin_show_screen'), 10, 2); //スクリーンの表示件数取得 add_filter('set-screen-option', array($this, 'admin_set_screen_options'), 10, 3); add_filter('contextual_help', array($this, 'admin_help_setting'), 900, 3); add_action('admin_print_footer_scripts', array($this, 'admin_scripts')); add_action('admin_print_footer_scripts', array($this, 'admin_page_scripts')); add_action('admin_footer', array($this, 'clear_action_status')); }
/** * Return an instance of this class. * * @since 1.0.0 * * @return object A single instance of this class. */ public static function get_instance() { /* * @TODO : * * - Uncomment following lines if the admin class should only be available for super admins */ /* if( ! is_super_admin() ) { return; } */ // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }