diff --git src/wp-admin/install.php src/wp-admin/install.php
index 4eab6b3..2c0c607 100644
|
|
|
function display_setup_form( $error = null ) { |
| 137 | 137 | </th> |
| 138 | 138 | <td> |
| 139 | 139 | <div class=""> |
| 140 | | <?php $initial_password = wp_generate_password( 18 ); ?> |
| | 140 | <?php $initial_password = isset( $_POST['admin_password'] ) ? stripslashes( $_POST['admin_password'] ) : wp_generate_password( 18 ); ?> |
| 141 | 141 | <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" /> |
| 142 | | <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> |
| | 142 | <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-start-masked="<?php echo (int) isset( $_POST['admin_password'] ); ?>" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> |
| 143 | 143 | <span class="dashicons dashicons-hidden"></span> |
| 144 | 144 | <span class="text"><?php _e( 'Hide' ); ?></span> |
| 145 | 145 | </button> |
diff --git src/wp-admin/js/user-profile.js src/wp-admin/js/user-profile.js
index 799ee97..bb80a32 100644
|
|
|
|
| 12 | 12 | $weakRow, |
| 13 | 13 | $weakCheckbox, |
| 14 | 14 | |
| | 15 | $toggleButton, |
| 15 | 16 | $submitButtons, |
| 16 | 17 | $submitButton, |
| 17 | 18 | currentPass; |
| … |
… |
|
| 22 | 23 | } else { |
| 23 | 24 | $pass1.val( $pass1.data( 'pw' ) ); |
| 24 | 25 | $pass1.trigger( 'pwupdate' ); |
| 25 | | $pass1Wrap.addClass( 'show-password' ); |
| | 26 | if ( 1 !== parseInt( $toggleButton.data( 'start-masked' ), 10 ) ) { |
| | 27 | $pass1Wrap.addClass( 'show-password' ); |
| | 28 | } else { |
| | 29 | $toggleButton.trigger( 'click' ); |
| | 30 | } |
| 26 | 31 | } |
| 27 | 32 | } |
| 28 | 33 | |
| … |
… |
|
| 82 | 87 | } |
| 83 | 88 | |
| 84 | 89 | function bindToggleButton() { |
| 85 | | var toggleButton = $pass1Row.find('.wp-hide-pw'); |
| 86 | | toggleButton.show().on( 'click', function () { |
| 87 | | if ( 1 === parseInt( toggleButton.data( 'toggle' ), 10 ) ) { |
| | 90 | $toggleButton = $pass1Row.find('.wp-hide-pw'); |
| | 91 | $toggleButton.show().on( 'click', function () { |
| | 92 | if ( 1 === parseInt( $toggleButton.data( 'toggle' ), 10 ) ) { |
| 88 | 93 | $pass1Wrap.addClass( 'show-password' ); |
| 89 | | toggleButton |
| | 94 | $toggleButton |
| 90 | 95 | .data( 'toggle', 0 ) |
| 91 | 96 | .attr({ |
| 92 | 97 | 'aria-label': userProfileL10n.ariaHide |
| … |
… |
|
| 105 | 110 | } |
| 106 | 111 | } else { |
| 107 | 112 | $pass1Wrap.removeClass( 'show-password' ); |
| 108 | | toggleButton |
| | 113 | $toggleButton |
| 109 | 114 | .data( 'toggle', 1 ) |
| 110 | 115 | .attr({ |
| 111 | 116 | 'aria-label': userProfileL10n.ariaShow |