Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/09/2010 07:49:03 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2554.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core/bp-core-wpabstraction.php

    r3117 r3160  
    2323
    2424    return true;
     25}
     26
     27/**
     28 * bp_core_is_main_site
     29 *
     30 * Checks if current blog is root blog of site
     31 *
     32 * @since 1,2,6
     33 * @package BuddyPress
     34 *
     35 * @param int $blog_id optional blog id to test (default current blog)
     36 * @return bool True if not multisite or $blog_id is main site
     37 */
     38function bp_core_is_main_site( $blog_id = '' ) {
     39    global $current_site, $current_blog;
     40
     41    if ( !bp_core_is_multisite() )
     42        return true;
     43
     44    if ( empty( $blog_id ) )
     45        $blog_id = $current_blog->blog_id;
     46
     47    return $blog_id == $current_site->blog_id;
    2548}
    2649
Note: See TracChangeset for help on using the changeset viewer.