get_active_blog_for_user

SummerySummery

Get one of a user’s active blogs

Syntax

get_active_blog_for_user( int $user_id )

DescriptionDescription

Returns the user’s primary blog, if they have one and it is active. If it’s inactive, function returns another active blog of the user. If none are found, the user is added as a Subscriber to the Dashboard Blog and that blog is returned.

ParametersParameters

$user_id

(int) (Required) The unique ID of the user

ReturnReturn

(WP_Site|void) The blog object

SourceSource

File: wp-includes/ms-functions.php


			

ChangelogChangelog

Changelog
Version Description
MU (3.0.0) Introduced.
Scroll to Top