WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/20/2016 09:38:08 PM (4 years ago)
Author:
jeremyfelt
Message:

Multisite: Revert [38388].

Restore get_current_site() to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.

See #37699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r38632 r38636  
    43104310 * @since 3.0.0
    43114311 *
     4312 * @global object $current_site
     4313 *
    43124314 * @param int $site_id Optional. Site ID to test. Defaults to current site.
    43134315 * @return bool True if $site_id is the main site of the network, or if not
     
    43154317 */
    43164318function is_main_site( $site_id = null ) {
    4317     if ( ! is_multisite() ) {
     4319    // This is the current network's information; 'site' is old terminology.
     4320    global $current_site;
     4321
     4322    if ( ! is_multisite() )
    43184323        return true;
    4319     }
    4320 
    4321     if ( ! $site_id ) {
     4324
     4325    if ( ! $site_id )
    43224326        $site_id = get_current_blog_id();
    4323     }
    4324     return (int) $site_id === (int) get_current_site()->blog_id;
     4327
     4328    return (int) $site_id === (int) $current_site->blog_id;
    43254329}
    43264330
Note: See TracChangeset for help on using the changeset viewer.