Files
wordpress/wp-includes
spacedmonkey 9eda48e9a4 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.
Built from https://develop.svn.wordpress.org/trunk@60992


git-svn-id: http://core.svn.wordpress.org/trunk@60328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2025-10-20 21:02:39 +00:00
..
2025-10-20 20:01:26 +00:00