bb_update_user_password

Updates a user's password in the database.

Description

(int) bb_update_user_password( (int) $user_id, (string) $password ); 

}

Returns (int)

Parameters (2)

0. $user_id (int)
The user id.
1. $password (string)
The password.

Usage

  1. if ( !function_exists( 'bb_update_user_password' ) ) { 
  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 password. 
  8. $password = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_update_user_password($user_id, $password); 
  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_password( $user_id, $password ) { 
  2. global $wp_users_object; 
  3.  
  4. $user_id = (int) $user_id; 
  5.  
  6. $wp_users_object->set_password( $password, $user_id ); 
  7.  
  8. return $user_id;