apply_filters( ‘pre_get_blogs_of_user’, null|object[] $sites, int $user_id, bool $all )

Filters the list of a user’s sites before it is populated.

Description

Returning a non-null value from the filter will effectively short circuit get_blogs_of_user() , returning that value instead.

Parameters

$sitesnull|object[]
An array of site objects of which the user is a member.
$user_idint
User ID.
$allbool
Whether the returned array should contain all sites, including those marked 'deleted', 'archived', or 'spam'. Default false.

Source

$sites = apply_filters( 'pre_get_blogs_of_user', null, $user_id, $all );

Changelog

VersionDescription
4.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.