Make WordPress Core

Changeset 56071


Ignore:
Timestamp:
06/27/2023 04:25:18 PM (3 years ago)
Author:
audrasjb
Message:

Users: Introduce the wp_update_user action.

This changeset introduces the wp_update_user action hook, which fires after the user has been updated and emails have been sent.

Props tanner-m, desrosj, lphoumpakka, oglekler, audrasjb, azzaoz.
Fixes #57843.

File:
1 edited

Legend:

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

    r55990 r56071  
    20312031 *
    20322032 *     @type int    $ID                   User ID. If supplied, the user will be updated.
    2033  *     @type string $user_pass            The plain-text user password.
     2033 *     @type string $user_pass            The plain-text user password for new users.
     2034 *                                        Hashed password for existing users.
    20342035 *     @type string $user_login           The user's login username.
    20352036 *     @type string $user_nicename        The URL-friendly user name.
     
    25212522        }
    25222523
     2524        $userdata_raw = $userdata;
     2525
    25232526        $user_id = isset( $userdata['ID'] ) ? (int) $userdata['ID'] : 0;
    25242527        if ( ! $user_id ) {
     
    27342737                }
    27352738        }
     2739
     2740        /**
     2741         * Fires after the user has been updated and emails have been sent.
     2742         *
     2743         * @since 6.3.0
     2744         *
     2745         * @param int   $user_id      The ID of the user that was just updated.
     2746         * @param array $userdata     The array of user data that was updated.
     2747         * @param array $userdata_raw The unedited array of user data that was updated.
     2748         */
     2749        do_action( 'wp_update_user', $user_id, $userdata, $userdata_raw );
    27362750
    27372751        return $user_id;
Note: See TracChangeset for help on using the changeset viewer.