Coding Standards: Rename the $clean or $ids variable in several functions to $non_cached_ids for clarity.

* `_get_non_cached_ids()`
* `update_meta_cache()`
* `update_object_term_cache()`

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48065 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-06-16 19:07:04 +00:00
parent e4937bc7dd
commit eff94648d7
3 changed files with 27 additions and 22 deletions

View File

@@ -926,24 +926,25 @@ function update_meta_cache( $meta_type, $object_ids ) {
return (bool) $check;
}
$cache_key = $meta_type . '_meta';
$ids = array();
$cache = array();
$cache_values = wp_cache_get_multiple( $object_ids, $cache_key );
$cache_key = $meta_type . '_meta';
$non_cached_ids = array();
$cache = array();
$cache_values = wp_cache_get_multiple( $object_ids, $cache_key );
foreach ( $cache_values as $id => $cached_object ) {
if ( false === $cached_object ) {
$ids[] = $id;
$non_cached_ids[] = $id;
} else {
$cache[ $id ] = $cached_object;
}
}
if ( empty( $ids ) ) {
if ( empty( $non_cached_ids ) ) {
return $cache;
}
// Get meta info.
$id_list = join( ',', $ids );
$id_list = join( ',', $non_cached_ids );
$id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id';
$meta_list = $wpdb->get_results( "SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $id_column ASC", ARRAY_A );
@@ -967,7 +968,7 @@ function update_meta_cache( $meta_type, $object_ids ) {
}
}
foreach ( $ids as $id ) {
foreach ( $non_cached_ids as $id ) {
if ( ! isset( $cache[ $id ] ) ) {
$cache[ $id ] = array();
}