Filters the hashing algorithm to use in the password_hash() and password_needs_rehash() functions.
Description
The default is the value of the PASSWORD_BCRYPT constant which means bcrypt is used. <strong>Important:</strong> 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: <ul> <li>PASSWORD_ARGON2I</li> <li>PASSWORD_ARGON2ID</li> <li>PASSWORD_DEFAULT</li> </ul> The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
Parameters
$algorithmstring|int
The hashing algorithm. Default is the value of the PASSWORD_BCRYPT constant.
2778* The values of the algorithm constants are strings in PHP7.4+and integers in PHP7.3and earlier.2779*2780* @since 6.8.02781*2782* @param string|int$algorithm The hashing algorithm.Default is the value of the `PASSWORD_BCRYPT` constant.2783*/2784$algorithm=apply_filters('wp_hash_password_algorithm',PASSWORD_BCRYPT);27852786/**2787* Filters the options passed to the password_hash()andpassword_needs_rehash() functions.2788*2789* The default hashing algorithm is bcrypt, but this can be changed via the {@see 'wp_hash_password_algorithm'}2790* filter. You must ensure that the options are appropriate for the algorithm in use.
History
Introduced in 6.8.0. 2 changes between 6.8.8 and 7.1.0.