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.



git-svn-id: https://develop.svn.wordpress.org/trunk@53083 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Wilson
2022-04-06 04:33:50 +00:00
parent 18a6ec7048
commit b72c1d00ae
2 changed files with 7 additions and 13 deletions

View File

@@ -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();