wp_get_password_hint()
Gets text with an explanation of how to create a strong password.
The text can be modified through the filter password_hint:
add_filter( 'password_hint', 'filter_function_name_3193' );
function filter_function_name_3193( $hint ){
return 'To make the password stronger, use numbers, symbols (! " ? $ % ^ &), lowercase and uppercase letters.';
}
1 time — 0.015789 sec (extremely slow) | 50000 times — 0.19 sec (very fast) | PHP 7.1.11, WP 4.9.5
Hooks from the function
Returns
String. Text.
Usage
wp_get_password_hint();
Examples
#1 An example of what the function return
echo wp_get_password_hint(); /* The Output text: Hint: The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ & ). */
Changelog
| Since 4.1.0 | Introduced. |
wp_get_password_hint() wp get password hint code WP 6.8.3
function wp_get_password_hint() {
$hint = __( 'Hint: The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ & ).' );
/**
* Filters the text describing the site's password complexity policy.
*
* @since 4.1.0
*
* @param string $hint The password hint text.
*/
return apply_filters( 'password_hint', $hint );
}