wp_hash_password_options
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 wp_hash_password_algorithm filter. You must ensure that the options are appropriate for the algorithm in use.
The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
Использование
add_filter( 'wp_hash_password_options', 'wp_kama_hash_password_options_filter', 10, 2 );
/**
* Function for `wp_hash_password_options` filter-hook.
*
* @param array $options Array of options to pass to the password hashing functions. By default this is an empty array which means the default options will be used.
* @param string|int $algorithm The hashing algorithm in use.
*
* @return array
*/
function wp_kama_hash_password_options_filter( $options, $algorithm ){
// filter...
return $options;
}
- $options(массив)
- Array of options to pass to the password hashing functions. By default this is an empty array which means the default options will be used.
- $algorithm(строка|int)
- The hashing algorithm in use.
Список изменений
| С версии 6.8.0 | Введена. |
Где вызывается хук
wp_hash_password_options
wp-includes/pluggable.php 2801
$options = apply_filters( 'wp_hash_password_options', array(), $algorithm );
wp-includes/pluggable.php 2918
$options = apply_filters( 'wp_hash_password_options', array(), $algorithm );