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

2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
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.