Beispiel #1
0
 /**
  * Return active instance of WP_Stream_Reports_Metaboxes, create one if it doesn't exist
  *
  * @return WP_Stream_Reports_Metaboxes
  */
 public static function get_instance()
 {
     if (empty(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }
 /**
  * Register Notification menu under Stream's main one
  *
  * @action admin_menu
  * @return void
  */
 public function register_menu()
 {
     if (self::$disallow_access) {
         return false;
     }
     self::$screen_id = add_submenu_page(WP_Stream_Admin::RECORDS_PAGE_SLUG, __('Reports', 'stream-reports'), __('Reports', 'stream-reports'), self::VIEW_CAP, self::REPORTS_PAGE_SLUG, array($this, 'page'));
     // Create nonce right away so it is accessible everywhere
     self::$nonce = array('wp_stream_reports_nonce' => wp_create_nonce('stream-reports-page'));
     $metabox = WP_Stream_Reports_Metaboxes::get_instance();
     add_action('load-' . self::$screen_id, array($metabox, 'load_page'));
 }