Last active
April 5, 2021 22:44
-
-
Save Dizolivemint/9a0060d0cd26b09cc73c59dd81927c2c to your computer and use it in GitHub Desktop.
WordPress Password Save Fix
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
// We want our front-end scripts queued on the login pages only | |
add_action( 'login_enqueue_scripts', array( $this, 'add_scripts' ) ); | |
/* Hide the username with CSS, instead of as a hidden form field. */ | |
// Dumb-browser-friendly solution is to wrap field in hidden div | |
$( '#resetpassform input[id=\'user_login\']' ).wrap( | |
'<div style="display:none">') | |
// Browsers are more likely to recognise the user ID if it's a text field | |
$( '#resetpassform input[id=\'user_login\']' ).attr( 'type', 'text' ) | |
// Just in case, make sure the textfield isn't editable by the user | |
$( '#resetpassform input[id=\'user_login\']' ).attr( 'readonly', true ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment