WordPress.org

Make WordPress Core

Ticket #25030: 25030.diff

File 25030.diff, 1.3 KB (added by jeremyfelt, 8 years ago)
  • src/wp-includes/functions.php

     
    15501550        }
    15511551
    15521552        // If multisite (and if not the main site in a post-MU network)
    1553         if ( is_multisite() && ! ( is_main_site() && defined( 'MULTISITE' ) ) ) {
     1553        if ( is_multisite() && ! ( is_main_network() && is_main_site() && defined( 'MULTISITE' ) ) ) {
    15541554
    15551555                if ( ! get_site_option( 'ms_files_rewriting' ) ) {
    15561556                        // If ms-files rewriting is disabled (networks created post-3.5), it is fairly straightforward:
     
    32643264}
    32653265
    32663266/**
     3267 * Checks either current site or a supplied site ID against the defined main site ID
     3268 * to determine if this is the main network.
     3269 *
     3270 * @since 3.7.0
     3271 * @package WordPress
     3272 *
     3273 * @param string $site_id optional site id to test (default current site)
     3274 *
     3275 * @return bool True if not multisite, if SITE_ID_CURRENT_SITE is not defined, or if $site_id is the main network
     3276 */
     3277function is_main_network( $site_id = '' ) {
     3278        global $current_site;
     3279
     3280        if ( ! is_multisite() )
     3281                return true;
     3282
     3283        if ( ! defined( 'SITE_ID_CURRENT_SITE' ) )
     3284                return true;
     3285
     3286        if ( ! $site_id )
     3287                $site_id = $current_site->id;
     3288
     3289        return SITE_ID_CURRENT_SITE == $site_id;
     3290}
     3291
     3292/**
    32673293 * Whether global terms are enabled.
    32683294 *
    32693295 *