WordPress generates passwords by function wp_generate_password() – documentation
At the end of the function there is hook random_password, so if you wnat to use your custom code to generate a password instead of native WP function, you need to add filter and in function you can write your custom code for generating password. This function will be called always at the end of wp_generate_password().
function custom_random_password( $password ) {
// here you make your password generation
$password = 'your-password';
return $password;
}
add_filter( 'random_password', 'custom_random_password' );
2
Answers
I used this plugin: bdvs password reset
You can simply reset password and set new password. I put example some code:
Reset Password:
Set New Password:
WordPress generates passwords by function
wp_generate_password()
– documentationAt the end of the function there is hook
random_password
, so if you wnat to use your custom code to generate a password instead of native WP function, you need to add filter and in function you can write your custom code for generating password. This function will be called always at the end ofwp_generate_password()
.