| @@ 220-226 (lines=7) @@ | ||
| 217 | * drawbacks depending on the setup, so this is best done per-install. |
|
| 218 | */ |
|
| 219 | $using_paths = true; |
|
| 220 | if ( wp_using_ext_object_cache() ) { |
|
| 221 | $using_paths = wp_cache_get( 'networks_have_paths', 'site-options' ); |
|
| 222 | if ( false === $using_paths ) { |
|
| 223 | $using_paths = (int) $wpdb->get_var( "SELECT id FROM {$wpdb->site} WHERE path <> '/' LIMIT 1" ); |
|
| 224 | wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' ); |
|
| 225 | } |
|
| 226 | } |
|
| 227 | ||
| 228 | $paths = array(); |
|
| 229 | if ( $using_paths ) { |
|
| @@ 4230-4237 (lines=8) @@ | ||
| 4227 | } elseif ( 1 === (int) get_current_site()->id ) { |
|
| 4228 | // If the current network has an ID of 1, assume it is the main network. |
|
| 4229 | $main_network_id = 1; |
|
| 4230 | } else { |
|
| 4231 | $main_network_id = wp_cache_get( 'primary_network_id', 'site-options' ); |
|
| 4232 | ||
| 4233 | if ( false === $main_network_id ) { |
|
| 4234 | $main_network_id = (int) $wpdb->get_var( "SELECT id FROM {$wpdb->site} ORDER BY id LIMIT 1" ); |
|
| 4235 | wp_cache_add( 'primary_network_id', $main_network_id, 'site-options' ); |
|
| 4236 | } |
|
| 4237 | } |
|
| 4238 | ||
| 4239 | /** |
|
| 4240 | * Filter the main network ID. |
|