Created
January 19, 2018 04:30
-
-
Save chandra10207/38f8b2a43030f580baf6323ae469ce96 to your computer and use it in GitHub Desktop.
When resetting passwords in WordPress a random password is automatically generated and pre-filled in the password field. to disable random password for password resets use this code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'random_password', 'itsg_disable_random_password', 10, 2 ); | |
function itsg_disable_random_password( $password ) { | |
$action = isset( $_GET['action'] ) ? $_GET['action'] : ''; | |
if ( 'wp-login.php' === $GLOBALS['pagenow'] && ( 'rp' == $action || 'resetpass' == $action ) ) { | |
return ''; | |
} | |
return $password; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment