bp_is_multiblog_mode()

Are we running multiblog mode?


Description 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 Return

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


Top ↑

Source 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 1.5.0
	 *
	 * @param bool $retval Whether or not we're running multiblog mode.
	 */
	return apply_filters( 'bp_is_multiblog_mode', $retval );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.