wp/wp-includes/class-wp-network.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   351 		 * This is a very basic optimization; anything further could have
   351 		 * This is a very basic optimization; anything further could have
   352 		 * drawbacks depending on the setup, so this is best done per-installation.
   352 		 * drawbacks depending on the setup, so this is best done per-installation.
   353 		 */
   353 		 */
   354 		$using_paths = true;
   354 		$using_paths = true;
   355 		if ( wp_using_ext_object_cache() ) {
   355 		if ( wp_using_ext_object_cache() ) {
   356 			$using_paths = wp_cache_get( 'networks_have_paths', 'site-options' );
   356 			$using_paths = get_networks(
   357 			if ( false === $using_paths ) {
   357 				array(
   358 				$using_paths = get_networks(
   358 					'number'       => 1,
   359 					array(
   359 					'count'        => true,
   360 						'number'       => 1,
   360 					'path__not_in' => '/',
   361 						'count'        => true,
   361 				)
   362 						'path__not_in' => '/',
   362 			);
   363 					)
       
   364 				);
       
   365 				wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' );
       
   366 			}
       
   367 		}
   363 		}
   368 
   364 
   369 		$paths = array();
   365 		$paths = array();
   370 		if ( $using_paths ) {
   366 		if ( $using_paths ) {
   371 			$path_segments = array_filter( explode( '/', trim( $path, '/' ) ) );
   367 			$path_segments = array_filter( explode( '/', trim( $path, '/' ) ) );