diff --git a/wp-includes/user.php b/wp-includes/user.php index 4b1fa4b34f..0d50c1f6e3 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2012,6 +2012,7 @@ function wp_insert_user( $userdata ) { * It only includes data in the users table, not any user metadata. * * @since 4.9.0 + * @since 5.8.0 The $userdata parameter was added. * * @param array $data { * Values and keys for the user. @@ -2025,10 +2026,11 @@ function wp_insert_user( $userdata ) { * @type string $user_registered MySQL timestamp describing the moment when the user registered. Defaults to * the current UTC timestamp. * } - * @param bool $update Whether the user is being updated rather than created. - * @param int|null $id ID of the user to be updated, or NULL if the user is being created. + * @param bool $update Whether the user is being updated rather than created. + * @param int|null $id ID of the user to be updated, or NULL if the user is being created. + * @param array $userdata The raw array of data passed to wp_insert_user(). */ - $data = apply_filters( 'wp_pre_insert_user_data', $data, $update, $update ? (int) $ID : null ); + $data = apply_filters( 'wp_pre_insert_user_data', $data, $update, ( $update ? (int) $ID : null ), $userdata ); if ( empty( $data ) || ! is_array( $data ) ) { return new WP_Error( 'empty_data', __( 'Not enough data to create this user.' ) ); @@ -2054,6 +2056,7 @@ function wp_insert_user( $userdata ) { * Does not include contact methods. These are added using `wp_get_user_contact_methods( $user )`. * * @since 4.4.0 + * @since 5.8.0 The $userdata parameter was added. * * @param array $meta { * Default meta values and keys for the user. @@ -2072,10 +2075,11 @@ function wp_insert_user( $userdata ) { * Default 'true'. * @type string $locale User's locale. Default empty. * } - * @param WP_User $user User object. - * @param bool $update Whether the user is being updated rather than created. + * @param WP_User $user User object. + * @param bool $update Whether the user is being updated rather than created. + * @param array $userdata The raw array of data passed to wp_insert_user(). */ - $meta = apply_filters( 'insert_user_meta', $meta, $user, $update ); + $meta = apply_filters( 'insert_user_meta', $meta, $user, $update, $userdata ); // Update user meta. foreach ( $meta as $key => $value ) { @@ -2101,11 +2105,13 @@ function wp_insert_user( $userdata ) { * Fires immediately after an existing user is updated. * * @since 2.0.0 + * @since 5.8.0 The $userdata parameter was added. * * @param int $user_id User ID. * @param WP_User $old_user_data Object containing user's data prior to update. + * @param array $userdata The raw array of data passed to wp_insert_user(). */ - do_action( 'profile_update', $user_id, $old_user_data ); + do_action( 'profile_update', $user_id, $old_user_data, $userdata ); if ( isset( $userdata['spam'] ) && $userdata['spam'] != $old_user_data->spam ) { if ( 1 == $userdata['spam'] ) { @@ -2133,10 +2139,12 @@ function wp_insert_user( $userdata ) { * Fires immediately after a new user is registered. * * @since 1.5.0 + * @since 5.8.0 The $userdata parameter was added. * - * @param int $user_id User ID. + * @param int $user_id User ID. + * @param array $userdata The raw array of data passed to wp_insert_user(). */ - do_action( 'user_register', $user_id ); + do_action( 'user_register', $user_id, $userdata ); } return $user_id; diff --git a/wp-includes/version.php b/wp-includes/version.php index 9bfb8eddd5..000ab6c5be 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-51004'; +$wp_version = '5.8-alpha-51005'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.