bp_xprofile_map_meta_caps

Filters the XProfile caps to built in WordPress caps.

Description

apply_filters( 'bp_xprofile_map_meta_caps', (array) $caps, (string) $cap, (int) $user_id, (mixed) $args ); 

Parameters (4)

0. $caps (array)
Capabilities for meta capability.
1. $cap (string)
Capability name.
2. $user_id (int)
User ID being mapped.
3. $args (mixed)
Capability arguments.

Usage

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

Defined (1)

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

/bp-xprofile/bp-xprofile-caps.php  
  1. return apply_filters( 'bp_xprofile_map_meta_caps', $caps, $cap, $user_id, $args );