map_meta_cap

Filters a user's capabilities depending on specific context and/or privilege.

Description

add_filter( 'map_meta_cap', (string) $monsterinsights_add_capabilities, (int) $int, (int) $int ); 

Parameters (3)

0. $monsterinsights_add_capabilities (string) => 'monsterinsights_add_capabilities'
The monsterinsights add capabilities.
1. $int (int) => 10
The int.
2. $int (int) => 4
The int.

Usage

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

Defined (1)

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

/includes/admin/capabilities.php  
  1. add_filter( 'map_meta_cap', 'monsterinsights_add_capabilities', 10, 4 );