Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/28/2024 03:30:07 AM (2 months ago)
Author:
espellcaste
Message:

Update the conditional that check if bp_classic is available.

Previously, we only checked if the bp_classic function was available, without checking if the plugin was also active.

Props imath, narenin, samedwards, and espellcaste.

Fixes #9181
Closes https://github.com/buddypress/buddypress/pull/371

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-wpabstraction.php

    r13968 r14029  
    430430}
    431431add_action( 'wp_validate_site_deletion', 'bp_delete_site', 10, 2 );
     432
     433if ( ! function_exists( 'is_plugin_active' ) ) {
     434    /**
     435     * Checks if a plugin is active.
     436     *
     437     * @since 15.0.0
     438     *
     439     * @param string $plugin Plugin path to check.
     440     * @return bool True if the plugin is active, false otherwise.
     441     */
     442    function is_plugin_active( $plugin ) {
     443        return in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) || ( is_multisite() && isset( get_site_option( 'active_sitewide_plugins' )[ $plugin ] ) );
     444    }
     445}
Note: See TracChangeset for help on using the changeset viewer.