Changeset 41718
- Timestamp:
- 10/03/2017 07:26:01 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-load.php
r41380 r41718 269 269 * @access private 270 270 * 271 * @global wpdb $wpdb WordPress database abstraction object.272 271 * @global WP_Network $current_site The current network. 273 272 * @global WP_Site $current_blog The current site. … … 282 281 */ 283 282 function ms_load_current_site_and_network( $domain, $path, $subdomain = false ) { 284 global $ wpdb, $current_site, $current_blog;283 global $current_site, $current_blog; 285 284 286 285 // If the network is defined in wp-config.php, we can simply use that. … … 315 314 if ( ! $current_site = wp_cache_get( 'current_network', 'site-options' ) ) { 316 315 // Are there even two networks installed? 317 $ one_network = $wpdb->get_row( "SELECT * FROM $wpdb->site LIMIT 2" ); // [sic]318 if ( 1 === $wpdb->num_rows) {319 $current_site = new WP_Network( $one_network);316 $networks = get_networks( array( 'number' => 2 ) ); 317 if ( count( $networks ) === 1 ) { 318 $current_site = array_shift( $networks ); 320 319 wp_cache_add( 'current_network', $current_site, 'site-options' ); 321 } elseif ( 0 === $wpdb->num_rows) {320 } elseif ( empty( $networks ) ) { 322 321 // A network not found hook should fire here. 323 322 return false;
Note: See TracChangeset
for help on using the changeset viewer.