| @@ 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 ) { |
|
| @@ 4306-4313 (lines=8) @@ | ||
| 4303 | } elseif ( isset( $current_site->id ) && 1 === (int) $current_site->id ) { |
|
| 4304 | // If the current network has an ID of 1, assume it is the main network. |
|
| 4305 | $main_network_id = 1; |
|
| 4306 | } else { |
|
| 4307 | $main_network_id = wp_cache_get( 'primary_network_id', 'site-options' ); |
|
| 4308 | ||
| 4309 | if ( false === $main_network_id ) { |
|
| 4310 | $main_network_id = (int) $wpdb->get_var( "SELECT id FROM {$wpdb->site} ORDER BY id LIMIT 1" ); |
|
| 4311 | wp_cache_add( 'primary_network_id', $main_network_id, 'site-options' ); |
|
| 4312 | } |
|
| 4313 | } |
|
| 4314 | ||
| 4315 | /** |
|
| 4316 | * Filters the main network ID. |
|