From 3a2043a98771802bb5ce7966d5bd1b28ec2b7c46 Mon Sep 17 00:00:00 2001 From: SirLouen Date: Sat, 8 Mar 2025 16:59:00 +0100 Subject: [PATCH] Refactor 41757 for MS functions --- src/wp-includes/ms-functions.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index 1f890dab69232..2075c995d95d8 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -2302,9 +2302,9 @@ function add_existing_user_to_blog( $details = false ) { * * @see add_user_to_blog() * - * @param int $user_id User ID. - * @param string $password User password. Ignored. - * @param array $meta Signup meta data. + * @param int $user_id + * @param mixed $password Accessible via 'added_new_user_to_blog' hook. + * @param array $meta */ function add_new_user_to_blog( $user_id, @@ -2321,6 +2321,18 @@ function add_new_user_to_blog( if ( ! is_wp_error( $result ) ) { update_user_meta( $user_id, 'primary_blog', $blog_id ); + + /** + * Fires when a new user is added to a network site without an error from $result. + * + * @since 4.9.0 + * + * @param int $user_id New user's ID. + * @param mixed $password New user's password. + * @param array $meta Array of meta data from the new registration. + * @param int $blog_id Blog ID. + */ + do_action( 'added_new_user_to_blog', $user_id, $password, $meta, $blog_id ); } } }