From 00ed89ffb16d2d7e2c8fc7d400f92349e67d9632 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Thu, 12 Jan 2023 09:05:15 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@55056 git-svn-id: http://core.svn.wordpress.org/trunk@54589 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 10 ++++++++++ wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 8ee9724331..b3921cddaf 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -2740,6 +2740,16 @@ if ( ! function_exists( 'wp_set_password' ) ) : ); clean_user_cache( $user_id ); + + /** + * Fires after the password is set. + * + * @since 6.2.0 + * + * @param string $password The plain text password just set. + * @param mixed $user_id The ID of the user whose password was just set. + */ + do_action( 'wp_set_password', $password, $user_id ); } endif; diff --git a/wp-includes/version.php b/wp-includes/version.php index 79a045d8b5..b29e1cbe57 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55055'; +$wp_version = '6.2-alpha-55056'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.