bp_is_network_activated()

Is BuddyPress active at the network level for this network?


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

(bool) True if BuddyPress is network activated.


Top ↑

Source 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 1.7.0
	 *
	 * @param bool $retval Whether or not we're network activated.
	 */
	return (bool) apply_filters( 'bp_is_network_activated', $retval );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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