Make WordPress Core

Opened 3 years ago

Last modified 8 months ago

#52256 reopened defect (bug)

Default hide password field.

Reported by: dilipbheda's profile dilipbheda Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.6
Component: Users Keywords: has-patch dev-feedback needs-testing
Focuses: javascript, administration Cc:


Generate password not working when the first click on generate password button.

Check different behavior in the below URLs


Check the video for a better understanding.

Attachments (2)

52256.patch (792 bytes) - added by dilipbheda 3 years ago.
#52256.patch (740 bytes) - added by rehanali 2 years ago.
Added patch

Download all attachments as: .zip

Change History (6)

3 years ago

#1 @9primus
3 years ago

  • Component changed from Users to Administration
  • Resolution set to invalid
  • Status changed from new to closed
  • Version changed from trunk to 5.6

Hello ! I have solved this bug.
To fix this bug paste code below from codesandbox into \wp-admin\js\user-profile.min.js folder

I have added one condition to generatePassword function :

		} else if ( ! $pass1.val() || $passwordWrapper.hasClass( 'is-open' ) ) {
			// zxcvbn loaded before user entered password, or generating new password.
			let firstPassword = $ 'pw' );
			if (firstPassword){
				$ 'pw',"" );

			$pass1.trigger( 'pwupdate' );

and edited ajax call in $generateButton.on( 'click',... function 'generate-password' )
				.done( function( data ) {
					$pass1.val( data );
				} );

Your input tag for password should be like this (Path : \wp-admin\user-new.php) :

                                <?php $initial_password = wp_generate_password( 24 ); ?>
                                <span class="password-input-wrapper">
                                        <input type="password" 
                                        name="pass1" id="pass1" class="regular-text" autocomplete="off" 
                                        data-reveal="1" value="" data-pw="<?php echo esc_attr( $initial_password ); ?>"
                                        aria-describedby="pass-strength-result" />

If it helps you , please reaply)

#2 @dilipbheda
3 years ago

  • Keywords dev-feedback needs-testing added
  • Resolution invalid deleted
  • Status changed from closed to reopened

#3 @SergeyBiryukov
3 years ago

  • Component changed from Administration to Users

2 years ago

Added patch

#4 @joedolson
8 months ago

#56363 was marked as a duplicate.

Note: See TracTickets for help on using tickets.