Commit 458daed
committed
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@60992 602fd350-edb4-49c9-b593-d223f7449a821 parent f20b265 commit 458daed
1 file changed
+6
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1196 | 1196 | | |
1197 | 1197 | | |
1198 | 1198 | | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
1207 | 1199 | | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1214 | 1204 | | |
| 1205 | + | |
1215 | 1206 | | |
1216 | | - | |
| 1207 | + | |
1217 | 1208 | | |
1218 | 1209 | | |
1219 | 1210 | | |
| |||
0 commit comments