Make WordPress Core


Ignore:
Timestamp:
07/06/2023 12:45:45 PM (5 months ago)
Author:
audrasjb
Message:

Users: Remove password reset links when the feature is not allowed for a specific user.

This also introduces wp_is_password_reset_allowed_for_user() which returns false when password reset is not allowed for a specific user. This can be
filtered by developers using the existing allow_password_reset hook.

Props ocean90, cshark, robinwpdeveloper, tahmina1du, kraftbj.
Fixes #58194.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r56008 r56150  
    682682
    683683                            <?php // Allow admins to send reset password link. ?>
    684                             <?php if ( ! IS_PROFILE_PAGE ) : ?>
     684                            <?php if ( ! IS_PROFILE_PAGE && true === wp_is_password_reset_allowed_for_user( $profile_user ) ) : ?>
    685685                                <tr class="user-generate-reset-link-wrap hide-if-no-js">
    686686                                    <th><?php _e( 'Password Reset' ); ?></th>
Note: See TracChangeset for help on using the changeset viewer.