bp_is_multiblog_mode()

Are we running multiblog mode?

Description

Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WordPress Multisite. "Multiblog" is BuddyPress setup that allows BuddyPress components to be viewed on every blog on the network, each with their own settings.

Thus, instead of having all ‘boonebgorges’ links go to http://example.com/members/boonebgorges on the root blog, each blog will have its own version of the same content, eg http://site2.example.com/members/boonebgorges (for subdomains) http://example.com/site2/members/boonebgorges (for subdirectories)

Multiblog mode is disabled by default, meaning that all BuddyPress content must be viewed on the root blog. It’s also recommended not to use the BP_ENABLE_MULTIBLOG constant beyond 1.7, as BuddyPress can now be activated on individual sites.

Why would you want to use this? Originally it was intended to allow BuddyPress to live in mu-plugins and be visible on mapped domains. This is a very small use-case with large architectural shortcomings, so do not go down this road unless you specifically need to.

Return

(bool) False when multiblog mode is disabled; true when enabled. Default: false.

Source

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

function bp_is_multiblog_mode() {

	// Setup some default values.
	$retval         = false;
	$is_multisite   = is_multisite();
	$network_active = bp_is_network_activated();
	$is_multiblog   = defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG;

	// Multisite, Network Activated, and Specifically Multiblog.
	if ( $is_multisite && $network_active && $is_multiblog ) {
		$retval = true;

	// Multisite, but not network activated.
	} elseif ( $is_multisite && ! $network_active ) {
		$retval = true;
	}

	/**
	 * Filters whether or not we're running in multiblog mode.
	 *
	 * @since BuddyPress 1.5.0
	 *
	 * @param bool $retval Whether or not we're running multiblog mode.
	 */
	return apply_filters( 'bp_is_multiblog_mode', $retval );
}

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.