wp_hash_password

Create a hash (encrypt) of a plain text password.

Description

(string) wp_hash_password( (string) $password ); 

For integration with other applications, this function can be overwritten to instead use the other package password checking algorithm.

Returns (string)

The hash string of the password

Parameters (1)

0. $password (string)
Plain text user password to hash

Usage

  1. if ( !function_exists( 'wp_hash_password' ) ) { 
  2. require_once ABSPATH . WPINC . '/pluggable.php'; 
  3.  
  4. // Plain text user password to hash 
  5. $password = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_hash_password($password); 
  9.  

Defined (1)

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

/wp-includes/pluggable.php  
  1. function wp_hash_password($password) { 
  2. global $wp_hasher; 
  3.  
  4. if ( empty($wp_hasher) ) { 
  5. // By default, use the portable hash from phpass 
  6. $wp_hasher = new PasswordHash(8, true); 
  7.  
  8. return $wp_hasher->HashPassword( trim( $password ) );