Make WordPress Core


Ignore:
Timestamp:
02/01/2021 10:11:46 PM (2 years ago)
Author:
adamsilverstein
Message:

Users: enable admins to send users a reset password link.

Add a feature so Admins can send users a 'password reset' email. This doesn't change the password or force a password change. It only emails the user the password reset link.

The feature appears in several places:

  • A "Send Reset Link" button on user profile screen.
  • A "Send password reset" option in the user list bulk action dropdown.
  • A "Send password reset" quick action when hovering over a username in the user list.

Props Ipstenu, DrewAPicture, eventualo, wonderboymusic, knutsp, ericlewis, afercia, JoshuaWold, johnbillion, paaljoachim, hedgefield.
Fixes #34281.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r50048 r50129  
    10791079    $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 );
    10801080    $scripts->set_translations( 'user-profile' );
     1081    $user_id = isset( $_GET['user_id'] ) ? (int) $_GET['user_id'] : 0;
     1082    did_action( 'init' ) && $scripts->localize(
     1083        'user-profile',
     1084        'userProfileL10n',
     1085        array(
     1086            'user_id'  => $user_id,
     1087            'nonce'    => wp_create_nonce( 'reset-password-for-' . $user_id ),
     1088        )
     1089    );
    10811090
    10821091    $scripts->add( 'language-chooser', "/wp-admin/js/language-chooser$suffix.js", array( 'jquery' ), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.