bb_is_trusted_user

The BuddyPress bb is trusted user hook.

Description

apply_filters( 'bb_is_trusted_user', (bool) $bool_array_intersect_bb_trusted_roles_user_roles, (unknown) $user_id ); 

Parameters (2)

0. $bool_array_intersect_bb_trusted_roles_user_roles (bool) => (bool) array_intersect(bb_trusted_roles(), $user->roles)
The bool array intersect bb trusted roles user roles.
1. $user_id (unknown)
The user id.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-users.php  
  1. return apply_filters( 'bb_is_trusted_user', (bool) array_intersect(bb_trusted_roles(), $user->roles), $user->ID );