bp_get_root_blog_id()

Get the ID of the root blog.

Description

The "root blog" is the blog on a WordPress network where BuddyPress content appears (where member profile URLs resolve, where a given theme is loaded, etc.).

Return

(int) The root site ID.

Source

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

function bp_get_root_blog_id() {

	/**
	 * Filters the ID for the root blog.
	 *
	 * @since BuddyPress 1.5.0
	 *
	 * @param int $root_blog_id ID for the root blog.
	 */
	return (int) apply_filters( 'bp_get_root_blog_id', (int) buddypress()->root_blog_id );
}

Changelog

Changelog
Version Description
BuddyPress 1.5.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.