Changeset 38814 for trunk/src/wp-includes/functions.php
- Timestamp:
- 10/19/2016 04:46:14 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r38810 r38814 4303 4303 * @since 3.0.0 4304 4304 * 4305 * @global object $current_site4306 *4307 4305 * @param int $site_id Optional. Site ID to test. Defaults to current site. 4308 4306 * @return bool True if $site_id is the main site of the network, or if not … … 4310 4308 */ 4311 4309 function is_main_site( $site_id = null ) { 4312 // This is the current network's information; 'site' is old terminology.4313 global $current_site;4314 4315 4310 if ( ! is_multisite() ) 4316 4311 return true; … … 4319 4314 $site_id = get_current_blog_id(); 4320 4315 4321 return (int) $site_id === (int) $current_site->blog_id;4316 return (int) $site_id === (int) get_network()->site_id; 4322 4317 } 4323 4318 … … 4335 4330 } 4336 4331 4337 $current_network_id = (int) get_current_site()->id;4338 4339 4332 if ( null === $network_id ) { 4340 $network_id = $current_network_id;4333 $network_id = get_current_network_id(); 4341 4334 } 4342 4335 … … 4358 4351 } 4359 4352 4360 $current_ site = get_current_site();4353 $current_network = get_network(); 4361 4354 4362 4355 if ( defined( 'PRIMARY_NETWORK_ID' ) ) { 4363 4356 $main_network_id = PRIMARY_NETWORK_ID; 4364 } elseif ( isset( $current_ site->id ) && 1 === (int) $current_site->id ) {4357 } elseif ( isset( $current_network->id ) && 1 === (int) $current_network->id ) { 4365 4358 // If the current network has an ID of 1, assume it is the main network. 4366 4359 $main_network_id = 1;
Note: See TracChangeset
for help on using the changeset viewer.