s2_capability

Hook the menu.

Description

apply_filters( 's2_capability', (string) $read, (string) $user ); 

Parameters (2)

0. $read (string) => "read"
The read.
1. $user (string) => 'user'
The user.

Usage

To run the hook, copy the example below.
  1. $read = apply_filters( 's2_capability', $read, $user ); 
  2.  
  3. if ( !empty( $read ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the s2_capability callback 
  2. function filter_s2_capability( $read, $user ) { 
  3. // make filter magic happen here... 
  4. return $read
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 's2_capability', 'filter_s2_capability', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 's2_capability', 'filter_s2_capability', 10, 2 ); 

Defined (5)

The filter is defined in the following location(s).

/classes/class-s2-admin.php  
  1. add_menu_page(__('Subscribe2', 'subscribe2'), __('Subscribe2', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', NULL, S2URL . 'include/email_edit.png'); 
  1. $s2user = add_submenu_page('s2', __('Your Subscriptions', 'subscribe2'), __('Your Subscriptions', 'subscribe2'), apply_filters('s2_capability', "read", 'user'), 's2', array(&$this, 'user_menu'), S2URL . 'include/email_edit.png'); 
  1. $s2subscribers = add_submenu_page('s2', __('Subscribers', 'subscribe2'), __('Subscribers', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'manage'), 's2_tools', array(&$this, 'subscribers_menu')); 
  1. $s2settings = add_submenu_page('s2', __('Settings', 'subscribe2'), __('Settings', 'subscribe2'), apply_filters('s2_capability', "manage_options", 'settings'), 's2_settings', array(&$this, 'settings_menu')); 
  1. $s2mail = add_submenu_page('s2', __('Send Email', 'subscribe2'), __('Send Email', 'subscribe2'), apply_filters('s2_capability', "publish_posts", 'send'), 's2_posts', array(&$this, 'write_menu'));