Changeset 41380 for trunk/src/wp-includes/ms-load.php
- Timestamp:
- 09/15/2017 11:14:49 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-load.php
r41289 r41380 136 136 /** 137 137 * Retrieves the closest matching site object by its domain and path. 138 * 138 * 139 139 * This will not necessarily return an exact match for a domain and path. Instead, it 140 140 * breaks the domain and path into pieces that are then used to match the closest … … 425 425 // Figure out the current network's main site. 426 426 if ( empty( $current_site->blog_id ) ) { 427 if ( $current_blog->domain === $current_site->domain && $current_blog->path === $current_site->path ) { 428 $current_site->blog_id = $current_blog->blog_id; 429 } elseif ( ! $current_site->blog_id = wp_cache_get( 'network:' . $current_site->id . ':main_site', 'site-options' ) ) { 430 $current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s", 431 $current_site->domain, $current_site->path ) ); 432 wp_cache_add( 'network:' . $current_site->id . ':main_site', $current_site->blog_id, 'site-options' ); 433 } 427 $current_site->blog_id = get_main_site_id( $current_site->id ); 434 428 } 435 429
Note: See TracChangeset
for help on using the changeset viewer.