bb_update_user_status

The BuddyPress bb update user status function.

Description

bb_update_user_status( $user_id, (int) $user_status = 0 ); 

Parameters (2)

0. $user_id
The user id.
1. $user_status — Optional. (int)
The user status.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-users.php  
  1. function bb_update_user_status( $user_id, $user_status = 0 ) { 
  2. global $wp_users_object; 
  3. $user = bb_get_user( $user_id ); 
  4. $user_status = (int) $user_status; 
  5. $wp_users_object->update_user( $user->ID, compact( 'user_status' ) );