A WordPress-centric search engine for devs and theme authors

pre_get_blogs_of_user ›

apply_filters( 'pre_get_blogs_of_user', null, $user_id, $all )
Parameters: (3)
  • (null|object[]) $sites An array of site objects of which the user is a member.
    Required: Yes
  • (int) $user_id User ID.
    Required: Yes
  • (bool) $all Whether the returned array should contain all sites, including those marked 'deleted', 'archived', or 'spam'. Default false.
    Required: Yes
Defined at:

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.


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