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
if ( !function_exists( 'wp_hash_password' ) ) { require_once ABSPATH . WPINC . '/pluggable.php'; } // Plain text user password to hash $password = ''; // NOTICE! Understand what this does before running. $result = wp_hash_password($password);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/pluggable.php
- function wp_hash_password($password) {
- global $wp_hasher;
- if ( empty($wp_hasher) ) {
- // By default, use the portable hash from phpass
- $wp_hasher = new PasswordHash(8, true);
- }
- return $wp_hasher->HashPassword( trim( $password ) );
- }