Make WordPress Core

Changeset 55056


Ignore:
Timestamp:
01/12/2023 09:03:29 AM (21 months ago)
Author:
audrasjb
Message:

Users: Add an action hook on wp_set_password().

This changeset introduces the wp_set_password action hook, triggered after a password is set for a given user. As several plugins are calling wp_set_password() directly, adding an action to the end of the function will help plugin authors to catch all instances of password setting.

Props tanner-m, audrasjb.
Fixes #57436.

File:
1 edited

Legend:

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

    r55044 r55056  
    27412741
    27422742        clean_user_cache( $user_id );
     2743
     2744        /**
     2745         * Fires after the password is set.
     2746         *
     2747         * @since 6.2.0
     2748         *
     2749         * @param string $password The plain text password just set.
     2750         * @param mixed  $user_id  The ID of the user whose password was just set.
     2751         */
     2752        do_action( 'wp_set_password', $password, $user_id );
    27432753    }
    27442754endif;
Note: See TracChangeset for help on using the changeset viewer.