Changeset 42343 for trunk/src/wp-includes/class-wp-network.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-network.php
r42043 r42343 126 126 */ 127 127 public function __construct( $network ) { 128 foreach ( get_object_vars( $network ) as $key => $value ) {128 foreach ( get_object_vars( $network ) as $key => $value ) { 129 129 $this->$key = $value; 130 130 } … … 255 255 $main_site_id = wp_cache_get( $cache_key, 'site-options' ); 256 256 if ( false === $main_site_id ) { 257 $_sites = get_sites( array( 258 'fields' => 'ids', 259 'number' => 1, 260 'domain' => $this->domain, 261 'path' => $this->path, 262 'network_id' => $this->id, 263 ) ); 257 $_sites = get_sites( 258 array( 259 'fields' => 'ids', 260 'number' => 1, 261 'domain' => $this->domain, 262 'path' => $this->path, 263 'network_id' => $this->id, 264 ) 265 ); 264 266 $main_site_id = ! empty( $_sites ) ? array_shift( $_sites ) : 0; 265 267 … … 283 285 } 284 286 285 $default = ucfirst( $this->domain );287 $default = ucfirst( $this->domain ); 286 288 $this->site_name = get_network_option( $this->id, 'site_name', $default ); 287 289 } … … 351 353 $using_paths = wp_cache_get( 'networks_have_paths', 'site-options' ); 352 354 if ( false === $using_paths ) { 353 $using_paths = get_networks( array( 354 'number' => 1, 355 'count' => true, 356 'path__not_in' => '/', 357 ) ); 358 wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' ); 355 $using_paths = get_networks( 356 array( 357 'number' => 1, 358 'count' => true, 359 'path__not_in' => '/', 360 ) 361 ); 362 wp_cache_add( 'networks_have_paths', $using_paths, 'site-options' ); 359 363 } 360 364 } … … 414 418 415 419 if ( ! $using_paths ) { 416 $networks = get_networks( array( 417 'number' => 1, 420 $networks = get_networks( 421 array( 422 'number' => 1, 423 'orderby' => array( 424 'domain_length' => 'DESC', 425 ), 426 'domain__in' => $domains, 427 ) 428 ); 429 430 if ( ! empty( $networks ) ) { 431 return array_shift( $networks ); 432 } 433 434 return false; 435 } 436 437 $networks = get_networks( 438 array( 418 439 'orderby' => array( 419 440 'domain_length' => 'DESC', 441 'path_length' => 'DESC', 420 442 ), 421 443 'domain__in' => $domains, 422 ) ); 423 424 if ( ! empty( $networks ) ) { 425 return array_shift( $networks ); 426 } 427 428 return false; 429 } 430 431 $networks = get_networks( array( 432 'orderby' => array( 433 'domain_length' => 'DESC', 434 'path_length' => 'DESC', 435 ), 436 'domain__in' => $domains, 437 'path__in' => $paths, 438 ) ); 444 'path__in' => $paths, 445 ) 446 ); 439 447 440 448 /*
Note: See TracChangeset
for help on using the changeset viewer.