bp_is_network_activated()

Is BuddyPress active at the network level for this network?

Description

Used to determine admin menu placement, and where settings and options are stored. If you’re being really clever and manually pulling BuddyPress in with an mu-plugin or some other method, you’ll want to filter ‘bp_is_network_activated’ and override the auto-determined value.

Return

(bool) True if BuddyPress is network activated.

Source

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

function bp_is_network_activated() {

	// Default to is_multisite().
	$retval  = is_multisite();

	// Check the sitewide plugins array.
	$base    = buddypress()->basename;
	$plugins = get_site_option( 'active_sitewide_plugins' );

	// Override is_multisite() if not network activated.
	if ( ! is_array( $plugins ) || ! isset( $plugins[ $base ] ) ) {
		$retval = false;
	}

	/**
	 * Filters whether or not we're active at the network level.
	 *
	 * @since BuddyPress 1.7.0
	 *
	 * @param bool $retval Whether or not we're network activated.
	 */
	return (bool) apply_filters( 'bp_is_network_activated', $retval );
}

Changelog

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