Make WordPress Core

Changeset 53083


Ignore:
Timestamp:
04/06/2022 04:33:50 AM (3 years ago)
Author:
peterwilsoncc
Message:

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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/schema.php

    r53011 r53083  
    11741174    }
    11751175
    1176     wp_cache_delete( 'networks_have_paths', 'site-options' );
    1177 
    11781176    if ( ! is_multisite() ) {
    11791177        $site_admins = array( $site_user->user_login );
  • trunk/src/wp-includes/class-wp-network.php

    r49927 r53083  
    354354        $using_paths = true;
    355355        if ( wp_using_ext_object_cache() ) {
    356             $using_paths = wp_cache_get( 'networks_have_paths', 'site-options' );
    357             if ( false === $using_paths ) {
    358                 $using_paths = get_networks(
    359                     array(
    360                         'number'       => 1,
    361                         'count'        => true,
    362                         'path__not_in' => '/',
    363                     )
    364                 );
    365                 wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' );
    366             }
     356            $using_paths = get_networks(
     357                array(
     358                    'number'       => 1,
     359                    'count'        => true,
     360                    'path__not_in' => '/',
     361                )
     362            );
    367363        }
    368364
Note: See TracChangeset for help on using the changeset viewer.