random_password
Filters the randomly-generated password.
Использование
add_filter( 'random_password', 'wp_kama_random_password_filter', 10, 4 );
/**
* Function for `random_password` filter-hook.
*
* @param string $password The generated password.
* @param int $length The length of password to generate.
* @param bool $special_chars Whether to include standard special characters.
* @param bool $extra_special_chars Whether to include other special characters.
*
* @return string
*/
function wp_kama_random_password_filter( $password, $length, $special_chars, $extra_special_chars ){
// filter...
return $password;
}
- $password(строка)
- The generated password.
- $length(int)
- The length of password to generate.
- $special_chars(true|false)
- Whether to include standard special characters.
- $extra_special_chars(true|false)
- Whether to include other special characters.
Список изменений
| С версии 3.0.0 | Введена. |
| С версии 5.3.0 | Added the $length, $special_chars, and $extra_special_chars parameters. |
Где вызывается хук
random_password
wp-includes/pluggable.php 2985
return apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars );