can_add_user_to_blog filter-hook . WP 4.9.0
Filters whether a user should be added to a site.
Usage
add_filter( 'can_add_user_to_blog', 'filter_function_name_2332', 10, 4 ); function filter_function_name_2332( $retval, $user_id, $role, $blog_id ){ // filter... return $retval; }
- $retval(true/WP_Error)
- True if the user should be added to the site, error object otherwise.
- $user_id(int)
- User ID.
- $role(string)
- User role.
- $blog_id(int)
- Site ID.
Changelog
Since 4.9.0 | Introduced. |
Where the hook is called
can_add_user_to_blog
wp-includes/ms-functions.php 188
$can_add_user = apply_filters( 'can_add_user_to_blog', true, $user_id, $role, $blog_id );