From 4a14685afd35a543127f8a829cad1e5a68b2c3a1 Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Thu, 7 Apr 2022 17:59:04 +0000 Subject: [PATCH] Networks and Sites: Improve cache key generation in `WP_Network_Query` class. Improve cache key generation in the `WP_Network_Query` class by removing `update_network_cache` element in the array used to generate the cache key. This element does not affect that cache and by removing it, it improves the likelihood of reusing an existing cache. Props Spacedmonkey, furi3r, johnbillion, johnjamesjacoby, flixos90. Fixes #55461. Built from https://develop.svn.wordpress.org/trunk@53098 git-svn-id: http://core.svn.wordpress.org/trunk@52687 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-network-query.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-network-query.php b/wp-includes/class-wp-network-query.php index 429143976c..ffdb956ad6 100644 --- a/wp-includes/class-wp-network-query.php +++ b/wp-includes/class-wp-network-query.php @@ -242,8 +242,8 @@ class WP_Network_Query { // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. $_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ); - // Ignore the $fields argument as the queried result will be the same regardless. - unset( $_args['fields'] ); + // Ignore the $fields, $update_network_cache arguments as the queried result will be the same regardless. + unset( $_args['fields'], $_args['update_network_cache'] ); $key = md5( serialize( $_args ) ); $last_changed = wp_cache_get_last_changed( 'networks' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 0df909c400..09f9a0a80f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53097'; +$wp_version = '6.0-alpha-53098'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.