bb_is_trusted_user

The BuddyPress bb is trusted user function.

Description

bb_is_trusted_user( $user ); 

Parameters (1)

0. $user
The user.

Usage

  1. if ( !function_exists( 'bb_is_trusted_user' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-users.php'; 
  3.  
  4. // The user. 
  5. $user = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_is_trusted_user($user); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-users.php  
  1. function bb_is_trusted_user( $user ) { // ID, user_login, WP_User, DB user obj 
  2. if ( is_numeric($user) || is_string($user) ) 
  3. $user = new BP_User( $user ); 
  4. elseif ( is_object($user) && is_a($user, 'BP_User') ); // Intentional 
  5. elseif ( is_object($user) && isset($user->ID) && isset($user->user_login) ) // Make sure it's actually a user object 
  6. $user = new BP_User( $user->ID ); 
  7. else 
  8. return; 
  9.  
  10. if ( !$user->ID ) 
  11. return; 
  12.  
  13. return apply_filters( 'bb_is_trusted_user', (bool) array_intersect(bb_trusted_roles(), $user->roles), $user->ID );