Changeset 34097 for trunk/src/wp-includes/ms-settings.php
- Timestamp:
- 09/13/2015 11:30:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-settings.php
r33990 r34097 11 11 */ 12 12 13 /** Include Multisite initialization functions */ 13 /** WP_Network class */ 14 require_once( ABSPATH . WPINC . '/class-wp-network.php' ); 15 16 /** Multisite loader */ 14 17 require_once( ABSPATH . WPINC . '/ms-load.php' ); 18 19 /** Default Multisite constants */ 15 20 require_once( ABSPATH . WPINC . '/ms-default-constants.php' ); 16 21 … … 76 81 $one_network = $wpdb->get_row( "SELECT * FROM $wpdb->site LIMIT 2" ); // [sic] 77 82 if ( 1 === $wpdb->num_rows ) { 78 $current_site = wp_get_network( $one_network );83 $current_site = new WP_Network( $one_network ); 79 84 wp_cache_add( 'current_network', $current_site, 'site-options' ); 80 85 } elseif ( 0 === $wpdb->num_rows ) { … … 111 116 $current_blog = get_site_by_path( $domain, $path, 1 ); 112 117 if ( $current_blog ) { 113 $current_site = wp_get_network( $current_blog->site_id ? $current_blog->site_id : 1 );118 $current_site = WP_Network::get_instance( $current_blog->site_id ? $current_blog->site_id : 1 ); 114 119 } else { 115 120 // If you don't have a site with the same domain/path as a network, you're pretty screwed, but: … … 120 125 // The network declared by the site trumps any constants. 121 126 if ( $current_blog && $current_blog->site_id != $current_site->id ) { 122 $current_site = wp_get_network( $current_blog->site_id );127 $current_site = WP_Network::get_instance( $current_blog->site_id ); 123 128 } 124 129 … … 180 185 } 181 186 182 // @todo What if the domain of the network doesn't match the current site?183 $current_site->cookie_domain = $current_site->domain;184 if ( 'www.' === substr( $current_site->cookie_domain, 0, 4 ) ) {185 $current_site->cookie_domain = substr( $current_site->cookie_domain, 4 );186 }187 188 187 // Figure out the current network's main site. 189 if ( ! isset( $current_site->blog_id ) ) {188 if ( empty( $current_site->blog_id ) ) { 190 189 if ( $current_blog->domain === $current_site->domain && $current_blog->path === $current_site->path ) { 191 190 $current_site->blog_id = $current_blog->blog_id; … … 219 218 wp_start_object_cache(); 220 219 221 if ( ! isset( $current_site->site_name ) ) { 220 if ( ! $current_site instanceof WP_Network ) { 221 $current_site = new WP_Network( $current_site ); 222 } 223 224 if ( empty( $current_site->site_name ) ) { 222 225 $current_site->site_name = get_site_option( 'site_name' ); 223 226 if ( ! $current_site->site_name ) {
Note: See TracChangeset
for help on using the changeset viewer.