Changeset 50153
- Timestamp:
- 02/02/2021 06:11:26 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/user-profile.js
r50129 r50153 158 158 $cancelButton; 159 159 160 $pass1Row = $( '.user-pass1-wrap, .user-pass-wrap ' );160 $pass1Row = $( '.user-pass1-wrap, .user-pass-wrap, .reset-pass-submit' ); 161 161 162 162 // Hide the confirm password field when JavaScript support is enabled. … … 462 462 } ); 463 463 464 /* 465 * We need to generate a password as soon as the Reset Password page is loaded, 466 * to avoid double clicking the button to retrieve the first generated password. 467 * See ticket #39638. 468 */ 469 $( document ).ready( function() { 470 if ( $( '.reset-pass-submit' ).length ) { 471 $( '.reset-pass-submit button.wp-generate-pw' ).trigger( 'click' ); 472 } 473 }); 474 464 475 })(jQuery); -
trunk/src/wp-admin/admin-ajax.php
r50129 r50153 165 165 } 166 166 167 add_action( 'wp_ajax_nopriv_generate-password', 'wp_ajax_nopriv_generate_password' ); 168 167 169 add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 ); 168 170 -
trunk/src/wp-admin/includes/ajax-actions.php
r50146 r50153 13 13 14 14 /** 15 * Ajax handler for the Heartbeat API in 16 * the no-privilege context. 15 * Ajax handler for the Heartbeat API in the no-privilege context. 17 16 * 18 17 * Runs when the user is not logged in. … … 3978 3977 3979 3978 /** 3979 * Ajax handler for generating a password in the no-privilege context. 3980 * 3981 * @since 5.7.0 3982 */ 3983 function wp_ajax_nopriv_generate_password() { 3984 wp_send_json_success( wp_generate_password( 24 ) ); 3985 } 3986 3987 /** 3980 3988 * Ajax handler for saving the user's WordPress.org username. 3981 3989 * -
trunk/src/wp-login.php
r50129 r50153 853 853 wp_enqueue_script( 'user-profile' ); 854 854 855 login_header( __( 'Reset Password' ), '<p class="message reset-pass">' . __( 'Enter your new password below .' ) . '</p>', $errors );855 login_header( __( 'Reset Password' ), '<p class="message reset-pass">' . __( 'Enter your new password below or generate one.' ) . '</p>', $errors ); 856 856 857 857 ?> … … 899 899 ?> 900 900 <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" /> 901 <p class="submit"> 902 <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Reset Password' ); ?>" /> 901 <p class="submit reset-pass-submit"> 902 <button type="button" class="button wp-generate-pw hide-if-no-js" aria-expanded="true"><?php _e( 'Generate Password' ); ?></button> 903 <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Save Password' ); ?>" /> 903 904 </p> 904 905 </form>
Note: See TracChangeset
for help on using the changeset viewer.