random_password filter-hookWP 3.0.0

Filters the randomly-generated password.

Usage

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(string)
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.

Changelog

Since 3.0.0 Introduced.
Since 5.3.0 Added the $length, $special_chars, and $extra_special_chars parameters.

Where the hook is called

wp_generate_password()
random_password
wp-includes/pluggable.php 2655
return apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars );

Where the hook is used in WordPress

Usage not found.