menu_cap() статический публичный Метод

* FeedWordPress::log_prefix ()
static public menu_cap ( $sub = false )
 function dashboard_setup()
 {
     $see_it = FeedWordPress::menu_cap();
     if (current_user_can($see_it)) {
         // Get the stylesheet
         wp_enqueue_style('feedwordpress-elements');
         $widget_id = 'feedwordpress_dashboard';
         $widget_name = __('Syndicated Sources');
         $column = 'side';
         $priority = 'core';
         // I would love to use wp_add_dashboard_widget() here and save
         // myself some trouble. But WP 3 does not yet have any way to
         // push a dashboard widget onto the side, or to give it a default
         // location.
         add_meta_box($widget_id, $widget_name, array(&$this, 'dashboard'), 'dashboard', $column, $priority);
         /*control_callback= array(&$this, 'dashboard_control') */
         // This is kind of rude, I know, but the dashboard widget isn't
         // worth much if users don't know that it exists, and I don't
         // know of any better way to reorder the boxen.
         //
         // Gleefully ripped off of codex.wordpress.org/Dashboard_Widgets_API
         // Globalize the metaboxes array, this holds all the widgets for wp-admin
         global $wp_meta_boxes;
         // Get the regular dashboard widgets array
         // (which has our new widget already but at the end)
         $normal_dashboard = $wp_meta_boxes['dashboard'][$column][$priority];
         // Backup and delete our new dashbaord widget from the end of the array
         if (isset($normal_dashboard[$widget_id])) {
             $backup = array();
             $backup[$widget_id] = $normal_dashboard[$widget_id];
             unset($normal_dashboard[$widget_id]);
             // Merge the two arrays together so our widget is at the
             // beginning
             $sorted_dashboard = array_merge($backup, $normal_dashboard);
             // Save the sorted array back into the original metaboxes
             $wp_meta_boxes['dashboard'][$column][$priority] = $sorted_dashboard;
         }
     }
 }
/** 
* Add subpage for overview page
* 
* Sets an overview page to the Feedwordpress submenu
*
*/
function overviewSubMenu()
{
    $menu_cap = FeedWordPress::menu_cap();
    $settings_cap = FeedWordPress::menu_cap(true);
    $syndicationMenu = FeedWordPress::path('syndication.php');
    $dirpath = plugin_basename(__DIR__) . "/";
    add_submenu_page($syndicationMenu, 'Advanced Filters Overview', 'Advanced Filters Overview', $settings_cap, $dirpath . 'advanced_filters_overview.php');
    if (FAF_DEBUG == true) {
        add_submenu_page($syndicationMenu, 'FAF Dbug', 'Advanced Filters Dbug', $settings_cap, plugin_dir_path(__FILE__) . 'dbug.php');
        add_submenu_page($syndicationMenu, 'FAF Unit Text', 'Advanced Filters Unit Test', $settings_cap, plugin_dir_path(__FILE__) . 'unit_test.php');
    }
}