[wp-trac] [WordPress Trac] #65096: Add `is_user_member_of_blog` filter

WordPress Trac noreply at wordpress.org
Sat Apr 18 04:42:33 UTC 2026


#65096: Add `is_user_member_of_blog` filter
-----------------------------+-----------------------------
 Reporter:  dd32             |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:
 Severity:  normal           |   Keywords:
  Focuses:  multisite        |
-----------------------------+-----------------------------
 WordPress uses `is_user_member_of_blog()` in the rest api controllers to
 prevent the user endpoints running for non-members of the site.

 For WordPress.org this caused an issue as 'no' users are members of the
 site on which we wanted users to be able to use the rest-api endpoints for
 various account purposes.

 This was resolved through faking the metadata such that it always returned
 truthful, without granting additional capabilities:
 https://github.com/WordPress/wporg-two-
 factor/pull/348#issuecomment-4206959949

 I've run into another use-case for it, where I want to dynamically grant a
 user access to a site, but I don't want to give the user a role directly.
 Causing me to use the same metadata filter approach.

 A filter on `is_user_member_of_blog` would make this a lot simpler.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65096>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list