bp_get_root_domain()

Return the “root domain”, the URL of the BP root blog.

Description

Return

(string) URL of the BP root blog.

Source

File: bp-core/bp-core-template.php

1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
function bp_get_root_domain() {
    $bp = buddypress();
 
    if ( ! empty( $bp->root_domain ) ) {
        $domain = $bp->root_domain;
    } else {
        $domain          = bp_core_get_root_domain();
        $bp->root_domain = $domain;
    }
 
    /**
     * Filters the "root domain", the URL of the BP root blog.
     *
     * @since BuddyPress 1.2.4
     *
     * @param string $domain URL of the BP root blog.
     */
    return apply_filters( 'bp_get_root_domain', $domain );
}

Changelog

Changelog
Version Description
BuddyPress 1.1.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.