WordPress at a glance
filter is not described

pre_get_blogs_of_user filter-hook . WP 4.6.0

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

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


add_filter( 'pre_get_blogs_of_user', 'filter_function_name_4669', 10, 3 );
function filter_function_name_4669( $sites, $user_id, $all ){
	// filter...

	return $sites;
An array of site objects of which the user is a member.
User ID.
Whether the returned array should contain all sites, including those marked 'deleted', 'archived', or 'spam'.
Default: false


Since 4.6.0 Introduced.

Where the hook is called

wp-includes/user.php 801
$sites = apply_filters( 'pre_get_blogs_of_user', null, $user_id, $all );

Where in WP core the hook is used WordPress

Usage not found.