[wp-trac] [WordPress Trac] #63989: is_user_member_of_blogs fetches all user meta keys

WordPress Trac noreply at wordpress.org
Mon Oct 20 21:01:05 UTC 2025


#63989: is_user_member_of_blogs fetches all user meta keys
-------------------------------------------------+-------------------------
 Reporter:  rinatkhaziev                         |       Owner:
                                                 |  spacedmonkey
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.9
Component:  Users                                |     Version:  trunk
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-testing dev-         |     Focuses:
  feedback                                       |  performance
-------------------------------------------------+-------------------------
Changes (by spacedmonkey):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60992" 60992]:
 {{{
 #!CommitTicketReference repository="" revision="60992"
 Users: Avoid fetching all user meta keys in is_user_member_of_blog()

 In [33771], is_user_member_of_blog() was optimised to improve the
 performance of get_blogs_of_user().
 That change used $meta_key = '' to fetch all user meta, which can cause
 unnecessary data loading and makes it difficult to use the
 get_{$meta_type}_metadata filter. When all meta keys are retrieved, it’s
 not possible to tell which specific meta value is being requested for
 short-circuiting or custom handling.

 This commit updates the logic to request only the meta key related to the
 blog’s capability check, reducing overhead and improving compatibility
 with metadata filters.

 Props rinatkhaziev, spacedmonkey.
 Fixes #63989.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63989#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list