wp_set_password
Action HookDescription
Fires after the user password is set.Hook Information
File Location |
wp-includes/pluggable.php
View on GitHub
|
Hook Type | Action |
Line Number | 3027 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$password
|
The plaintext password just set. |
int
|
$user_id
|
The ID of the user whose password was just set. |
WP_User
|
$old_user_data
|
Object containing user's data prior to update. |
Usage Examples
Basic Usage
<?php
// Hook into wp_set_password
add_action('wp_set_password', 'my_custom_function', 10, 3);
function my_custom_function($password, $user_id, $old_user_data) {
// Your custom code here
}
Source Code Context
wp-includes/pluggable.php:3027
- How this hook is used in WordPress core
<?php
3022 *
3023 * @param string $password The plaintext password just set.
3024 * @param int $user_id The ID of the user whose password was just set.
3025 * @param WP_User $old_user_data Object containing user's data prior to update.
3026 */
3027 do_action( 'wp_set_password', $password, $user_id, $old_user_data );
3028 }
3029 endif;
3030
3031 if ( ! function_exists( 'get_avatar' ) ) :
3032 /**
PHP Documentation
<?php
/**
* Fires after the user password is set.
*
* @since 6.2.0
* @since 6.7.0 The `$old_user_data` parameter was added.
*
* @param string $password The plaintext password just set.
* @param int $user_id The ID of the user whose password was just set.
* @param WP_User $old_user_data Object containing user's data prior to update.
*/
Quick Info
- Hook Type: Action
- Parameters: 3
- File: wp-includes/pluggable.php
Related Hooks
Related hooks will be displayed here in future updates.