Filters whether a user should be added to a site.
$retvaltrue|WP_Error$user_idint$rolestring$blog_idintwp-includes/ms-functions.php:182add_user_to_blog() * @param true|WP_Error $retval True if the user should be added to the site, error * object otherwise. * @param int $user_id User ID. * @param string $role User role. * @param int $blog_id Site ID. */ $can_add_user = apply_filters( 'can_add_user_to_blog', true, $user_id, $role, $blog_id ); if ( true !== $can_add_user ) { restore_current_blog(); if ( is_wp_error( $can_add_user ) ) { return $can_add_user;Introduced in 4.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.