@@ 295-301 (lines=7) @@ | ||
292 | * drawbacks depending on the setup, so this is best done per-install. |
|
293 | */ |
|
294 | $using_paths = true; |
|
295 | if ( wp_using_ext_object_cache() ) { |
|
296 | $using_paths = wp_cache_get( 'networks_have_paths', 'site-options' ); |
|
297 | if ( false === $using_paths ) { |
|
298 | $using_paths = (int) $wpdb->get_var( "SELECT id FROM {$wpdb->site} WHERE path <> '/' LIMIT 1" ); |
|
299 | wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' ); |
|
300 | } |
|
301 | } |
|
302 | ||
303 | $paths = array(); |
|
304 | if ( $using_paths ) { |
@@ 4309-4316 (lines=8) @@ | ||
4306 | } elseif ( isset( $current_site->id ) && 1 === (int) $current_site->id ) { |
|
4307 | // If the current network has an ID of 1, assume it is the main network. |
|
4308 | $main_network_id = 1; |
|
4309 | } else { |
|
4310 | $main_network_id = wp_cache_get( 'primary_network_id', 'site-options' ); |
|
4311 | ||
4312 | if ( false === $main_network_id ) { |
|
4313 | $main_network_id = (int) $wpdb->get_var( "SELECT id FROM {$wpdb->site} ORDER BY id LIMIT 1" ); |
|
4314 | wp_cache_add( 'primary_network_id', $main_network_id, 'site-options' ); |
|
4315 | } |
|
4316 | } |
|
4317 | ||
4318 | /** |
|
4319 | * Filters the main network ID. |