Пример #1
1
 public function __construct($args = array())
 {
     $screen = WP_Screen::get(Tribe__Events__Aggregator__Records::$post_type);
     $default = array('screen' => $screen, 'tab' => Tribe__Events__Aggregator__Tabs::instance()->get_active());
     $args = wp_parse_args($args, $default);
     parent::__construct($args);
     // Set Current Tab
     $this->tab = $args['tab'];
     // Set page Instance
     $this->page = Tribe__Events__Aggregator__Page::instance();
     // Set current user
     $this->user = wp_get_current_user();
 }
Пример #2
0
 /**
  * Static Singleton Factory Method
  *
  * @return self
  */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Пример #3
0
 /**
  * A private method to prevent it to be created twice.
  * It will add the methods and setup any dependencies
  */
 private function __construct()
 {
     $plugin = Tribe__Events__Main::instance();
     add_action('admin_menu', array($this, 'register_menu_item'));
     add_action('current_screen', array($this, 'action_request'));
     add_action('init', array($this, 'init'));
     // filter the plupload default settings to remove mime type restrictions
     add_filter('plupload_default_settings', array($this, 'filter_plupload_default_settings'));
     // Setup Tabs Instance
     $this->tabs = Tribe__Events__Aggregator__Tabs::instance();
     tribe_notice('tribe-aggregator-legacy-import-plugins-active', array($this, 'notice_legacy_plugins'), 'type=warning');
 }
Пример #4
0
 /**
  * Determines if this Tab is currently displayed
  *
  * @return boolean
  */
 public function is_active()
 {
     return Tribe__Events__Aggregator__Tabs::instance()->is_active($this->get_slug());
 }