Remove unreachable code in get_active_blog_for_user()
|Reported by:||jeremyfelt||Owned by:|
get_active_blog_for_user() accounts for a case where get_user_meta( $user_id, 'primary_blog', true ); returns false. I believe the only possible way for this to happen is via a misguided filter on get_user_metadata.
If for some reason false was returned, the existing code sets the user as a subscriber on the first site it finds the user has access to, overwriting any existing capabilities. (See also #15316)
The function then returns a blog object that may not meet the full expectations of a blog object being returned by the function. (See also #18789)
The attached patch removes this extra, unnecessary code.