pre_get_blogs_of_user WordPress Filter Hook

The pre_get_blogs_of_user hook is called before the WordPress Get Blogs Of User API call. It allows for modification of the query that is used to fetch the blogs of a user.

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.


Top ↑

Parameters

$sites

(null|object[])An array of site objects of which the user is a member.

$user_id

(int)User ID.

$all

(bool)Whether the returned array should contain all sites, including those marked 'deleted', 'archived', or 'spam'. Default false.


Top ↑

Source

File: wp-includes/user.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More