bb_give_user_default_role

Give a user the default role.

Description

bb_give_user_default_role( (BP_User) $user ); 

Parameters (1)

0. $user (BP_User)
User object to give default role to

Usage

  1. if ( !function_exists( 'bb_give_user_default_role' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-capabilities.php'; 
  3.  
  4. // User object to give default role to 
  5. $user = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_give_user_default_role($user); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-capabilities.php  
  1. function bb_give_user_default_role( $user ) { 
  2. if ( !( is_object($user) && is_a($user, 'BP_User') ) ) 
  3. return; 
  4. $user->set_role('member');