Make WordPress Core

Changeset 12714


Ignore:
Timestamp:
01/12/2010 09:52:51 PM (15 years ago)
Author:
wpmuguru
Message:

add is_main_site() function, See #11644

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes

    • Property svn:ignore set to
      .functions.php.swp
  • trunk/wp-includes/functions.php

    r12698 r12714  
    34633463
    34643464/**
     3465 * is main site
     3466 *
     3467 *
     3468 * @since 3.0.0
     3469 * @package WordPress
     3470 *
     3471 * @param int $blog_id optional blog id to test (default current blog)
     3472 * @return bool True if not multisite or $blog_id is main site
     3473 */
     3474function is_main_site( $blog_id = '' ) {
     3475    global $current_site, $current_blog;
     3476
     3477    if ( !is_multisite() )
     3478        return true;
     3479
     3480    if ( !$blog_id )
     3481        $blog_id = $current_blog->blog_id;
     3482
     3483    return $blog_id == $current_site->blog_id;
     3484}
     3485
     3486/**
    34653487 * gmt_offset modification for smart timezone handling
    34663488 *
Note: See TracChangeset for help on using the changeset viewer.