Make WordPress Core


Ignore:
Timestamp:
02/01/2021 10:11:46 PM (4 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-admin/user-edit.php

    r50006 r50129  
    610610</tr>
    611611<?php endif; ?>
     612        <?php
     613        // Allow admins to send reset password link
     614        if ( ! IS_PROFILE_PAGE ) :
     615            ?>
     616    <tr class="user-sessions-wrap hide-if-no-js">
     617        <th><?php _e( 'Password Reset' ); ?></th>
     618        <td>
     619            <div class="generate-reset-link">
     620                <button type="button" class="button button-secondary" id="generate-reset-link">
     621                    <?php _e( 'Send Reset Link' ); ?>
     622                </button>
     623            </div>
     624            <p class="description">
     625                <?php
     626                /* translators: 1: User's display name. */
     627                printf( __( 'Send %s a link to reset their password. This will not change their password, nor will it force a change.' ), esc_html( $profileuser->display_name ) );
     628                ?>
     629            </p>
     630        </td>
     631    </tr>
     632        <?php endif; ?>
    612633
    613634        <?php
Note: See TracChangeset for help on using the changeset viewer.