WPDev.one
Core Function
View Source on Trac ↗

get_blogs_of_user()

get_blogs_of_user( mixed $user_id, mixed $all = false )

Gets the sites a user belongs to.

Parameters 2 required

Name / Type Description
$user_id
int

User ID

Required
bool

$all Whether to retrieve all sites, or only sites that are not marked as deleted, archived, or spam.

Required

Return Value

(object[])
object[] A list of the user's sites. An empty array if the user doesn't exist or belongs to no sites.

Function Information

Since Version
3.0.0
Source File
wp-includes/user.php
Advertisement