bb_update_user

Updates a user's details in the database.

Description

(int) bb_update_user( (int) $user_id, (string) $user_email, (string) $user_url, (string) $display_name ); 

}

Returns (int)

Parameters (4)

0. $user_id (int)
The user id.
1. $user_email (string)
The user email.
2. $user_url (string)
The user url.
3. $display_name (string)
The display name.

Usage

  1. if ( !function_exists( 'bb_update_user' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-users.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // The user email. 
  8. $user_email = ''; 
  9.  
  10. // The user url. 
  11. $user_url = ''; 
  12.  
  13. // The display name. 
  14. $display_name = ''; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bb_update_user($user_id, $user_email, $user_url, $display_name); 
  18.  

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( $user_id, $user_email, $user_url, $display_name ) { 
  2. global $wp_users_object; 
  3.  
  4. $user_id = (int) $user_id; 
  5. $user_url = bb_fix_link( $user_url ); 
  6.  
  7. $wp_users_object->update_user( $user_id, compact( 'user_email', 'user_url', 'display_name' ) ); 
  8.  
  9. return $user_id;