Skip to:
Content

BuddyPress.org

Changeset 4174


Ignore:
Timestamp:
04/07/2011 09:17:41 PM (14 years ago)
Author:
boonebgorges
Message:

Introduces bp_is_root_blog() function. Fixes #3132

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-functions.php

    r4172 r4174  
    768768}
    769769
     770/**
     771 * Is this BP_ROOT_BLOG?
     772 *
     773 * @package BuddyPress
     774 * @since 1.3
     775 *
     776 * @param int $blog_id Optional. Defaults to the current blog id.
     777 * @return bool $is_root_blog Returns true if this is BP_ROOT_BLOG.
     778 */
     779function bp_is_root_blog( $blog_id = false ) {
     780    $is_root_blog = true;
     781   
     782    if ( !$blog_id )
     783        $blog_id = get_current_blog_id();
     784
     785    if ( $blog_id != BP_ROOT_BLOG )
     786        $is_root_blog = false;
     787
     788    return apply_filters( 'bp_is_root_blog', $is_root_blog );
     789}
     790
    770791/** Global Manipulators *******************************************************/
    771792
Note: See TracChangeset for help on using the changeset viewer.