Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/wp-includes/ms-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +2305 to +2307
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Descriptions for user_id and meta will need to be retained, password is still a string.

*/
function add_new_user_to_blog(
$user_id,
Expand All @@ -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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Fires when a new user is added to a network site without an error from $result.
* Fires when a new user is successfully added to a network site.

*
* @since 4.9.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @since 4.9.0
* @since 6.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 );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming things: I'd go with the following as I think it a better practice to use the wp_ prefix followed by the name of the function. I care more about the prefix that changing added to add.

Suggested change
do_action( 'added_new_user_to_blog', $user_id, $password, $meta, $blog_id );
do_action( 'wp_add_new_user_to_blog', $user_id, $password, $meta, $blog_id );

}
}
}
Expand Down
Loading