bbp_map_meta_caps

Maps forum/topic/reply caps to built in WordPress caps.

Description

bbp_map_meta_caps( (array) $caps = array(), (string) $cap = '', (int) $user_id = 0, (array) $args = array() ); 

Parameters (4)

0. $caps — Optional. (array) => array()
Capabilities for meta capability
1. $cap — Optional. (string) => ''
Capability name
2. $user_id — Optional. (int)
The user id.
3. $args — Optional. (array) => array()
The args.

Usage

  1. if ( !function_exists( 'bbp_map_meta_caps' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/core/sub-actions.php'; 
  3.  
  4. // Capabilities for meta capability 
  5. $caps = array(); 
  6.  
  7. // Capability name 
  8. $cap = ''; 
  9.  
  10. // The user id. 
  11. $user_id = -1; 
  12.  
  13. // The args. 
  14. $args = array(); 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bbp_map_meta_caps($caps, $cap, $user_id, $args); 
  18.  

Defined (1)

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

/includes/core/sub-actions.php  
  1. function bbp_map_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { 
  2. return apply_filters( 'bbp_map_meta_caps', $caps, $cap, $user_id, $args );