From d7d9102b0694ec0fbfd72750607d5527ad272586 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Wed, 6 Apr 2022 04:35:00 +0000 Subject: [PATCH] Networks and Sites: Remove duplicate cache entry. Remove the `networks_have_paths, site-options` cache entry as it duplicates caching within the `WP_Network_Query` class. Props uday17035, spacedmonkey, johnbillion, johnjamesjacoby. Fixes #42070. Built from https://develop.svn.wordpress.org/trunk@53083 git-svn-id: http://core.svn.wordpress.org/trunk@52672 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/schema.php | 2 -- wp-includes/class-wp-network.php | 18 +++++++----------- wp-includes/version.php | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 89ca9d8b30..a9978bc3b3 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -1173,8 +1173,6 @@ function populate_network_meta( $network_id, array $meta = array() ) { wp_cache_delete( $network_id, 'networks' ); } - wp_cache_delete( 'networks_have_paths', 'site-options' ); - if ( ! is_multisite() ) { $site_admins = array( $site_user->user_login ); $users = get_users( diff --git a/wp-includes/class-wp-network.php b/wp-includes/class-wp-network.php index fbd922951a..956fb6ddac 100644 --- a/wp-includes/class-wp-network.php +++ b/wp-includes/class-wp-network.php @@ -353,17 +353,13 @@ class WP_Network { */ $using_paths = true; if ( wp_using_ext_object_cache() ) { - $using_paths = wp_cache_get( 'networks_have_paths', 'site-options' ); - if ( false === $using_paths ) { - $using_paths = get_networks( - array( - 'number' => 1, - 'count' => true, - 'path__not_in' => '/', - ) - ); - wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' ); - } + $using_paths = get_networks( + array( + 'number' => 1, + 'count' => true, + 'path__not_in' => '/', + ) + ); } $paths = array(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 3b25f7fff2..e8b3140256 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-53082'; +$wp_version = '6.0-alpha-53083'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.