This page redirects to an external site: https://developer.wordpress.org/reference/hooks/random_password/
random_password filters the randomly generated password created during the wp_generate_password().
The following example would do something for the name_of_function() function:
add_filter( 'random_password', 'my_random_password' );
function my_random_password() {
$characters ='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$length = 10;
$password = '';
for( $i = 0; $i < $length; $i++ ) {
$password .= substr( $characters , wp_rand( 0, strlen( $characters ) - 1 ), 1 );
}
return $password;
}
Since: 3.0
random_password is located in wp-includes/pluggable.php