apply_filters( 'wp_hash_password_algorithm', string|int $algorithm )
- Since
- 6.8.0
Description
The default is the value of the PASSWORD_BCRYPT constant which means bcrypt is used.
Important: The only password hashing algorithm that is guaranteed to be available across PHP installations is bcrypt. If you use any other algorithm you must make sure that it is available on the server. The password_algos() function can be used to check which hashing algorithms are available.
The hashing options can be controlled via the 'wp_hash_password_options' filter.
Other available constants include:
PASSWORD_ARGON2IPASSWORD_ARGON2IDPASSWORD_DEFAULT
The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
Compatibility
- WordPress
- since 6.8.0
- 6.7.10
- 6.8.11
- 6.9.10
- 7.0.7
- 7.1.3
Present in 4 of the 5 tracked releases, added in 6.8.0.
Parameters
$algorithmstring|int- The hashing algorithm. Default is the value of the
PASSWORD_BCRYPTconstant.
Where this hook fires · 2
wp-includes/pluggable.php:2784wp_hash_password()wp-includes/pluggable.php:2915wp_password_needs_rehash()
Source code
* The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier. * * @since 6.8.0 * * @param string|int $algorithm The hashing algorithm. Default is the value of the `PASSWORD_BCRYPT` constant. */ $algorithm = apply_filters( 'wp_hash_password_algorithm', PASSWORD_BCRYPT ); /** * Filters the options passed to the password_hash() and password_needs_rehash() functions. * * The default hashing algorithm is bcrypt, but this can be changed via the {@see 'wp_hash_password_algorithm'} * filter. You must ensure that the options are appropriate for the algorithm in use.Changelog
Introduced in 6.8.0. 2 changes between 6.8.11 and 7.1.3.
Signature, return type and hooks compared across 4 parsed releases.
$algorithm retyped from string|int to string.verified against source$algorithm retyped from string to string|int.verified against sourceAbout this page
- Parsed data
- Generated from the wordpress-develop 6.9.10 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.