Networks and Sites: Lazy load site meta.

In [36566] a framework to lazily load metadata was introduced. This supported term and comment meta by default. In this commit, extends support for site ( blog ) meta. Site meta is not heavily used by core and is used by developers to extend multisite. In this change, `_prime_site_caches` and `WP_Site_Query` now call the new function `wp_lazyload_site_meta`. The function `wp_lazyload_site_meta` accepts an array of ids and adds them to the queue of metadata to be lazily loaded. The function `get_blogs_of_user` was updated to now lazily load site meta. 

Follow on from [55671].

Props spacedmonkey, johnjamesjacoby, peterwilsoncc, mukesh27.
Fixes #58185.
Built from https://develop.svn.wordpress.org/trunk@55747


git-svn-id: http://core.svn.wordpress.org/trunk@55259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
spacedmonkey
2023-05-11 11:15:24 +00:00
parent 041f2d982f
commit 3ac5fd72d0
5 changed files with 33 additions and 6 deletions

View File

@@ -1004,9 +1004,8 @@ function get_blogs_of_user( $user_id, $all = false ) {
if ( ! empty( $site_ids ) ) {
$args = array(
'number' => '',
'site__in' => $site_ids,
'update_site_meta_cache' => false,
'number' => '',
'site__in' => $site_ids,
);
if ( ! $all ) {
$args['archived'] = 0;