Users: Revert Lazy-load user meta.
With [60915] reverted, this changeset is also being reverted to resolve test failures due to common code. Reverts [60989]. Follow-up to [61037]. Props jorbin, ellatrix, spacedmonkey. See #63021, #58001. Built from https://develop.svn.wordpress.org/trunk@61038 git-svn-id: http://core.svn.wordpress.org/trunk@60374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -65,10 +65,6 @@ class WP_Metadata_Lazyloader {
|
||||
'filter' => 'get_blog_metadata',
|
||||
'callback' => array( $this, 'lazyload_meta_callback' ),
|
||||
),
|
||||
'user' => array(
|
||||
'filter' => 'get_user_metadata',
|
||||
'callback' => array( $this, 'lazyload_meta_callback' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,8 +125,7 @@ if ( ! function_exists( 'cache_users' ) ) :
|
||||
function cache_users( $user_ids ) {
|
||||
global $wpdb;
|
||||
|
||||
$user_ids = array_unique( array_map( 'intval', $user_ids ), SORT_NUMERIC );
|
||||
wp_lazyload_user_meta( $user_ids );
|
||||
update_meta_cache( 'user', $user_ids );
|
||||
|
||||
$clean = _get_non_cached_ids( $user_ids, 'users' );
|
||||
|
||||
|
||||
@@ -1310,21 +1310,6 @@ function update_user_meta( $user_id, $meta_key, $meta_value, $prev_value = '' )
|
||||
return update_metadata( 'user', $user_id, $meta_key, $meta_value, $prev_value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Queue user meta for lazy-loading.
|
||||
*
|
||||
* @since 6.9.0
|
||||
*
|
||||
* @param int[] $user_ids List of user IDs.
|
||||
*/
|
||||
function wp_lazyload_user_meta( array $user_ids ) {
|
||||
if ( empty( $user_ids ) ) {
|
||||
return;
|
||||
}
|
||||
$lazyloader = wp_metadata_lazyloader();
|
||||
$lazyloader->queue_objects( 'user', $user_ids );
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts number of users who have each of the user roles.
|
||||
*
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.9-alpha-61037';
|
||||
$wp_version = '6.9-alpha-61038';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user