Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/28/2021 02:02:28 PM (3 years ago)
Author:
imath
Message:

Let advanced users disable the WP Admin community profile

Introduce the bp_members_is_community_profile_enabled() function to check the community profile is enabled. Advanced users can edit this status returning false when filtering bp_members_is_community_profile_enabled.

Props vanpop, dcavins

Fixes #8479

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-admin.php

    r13105 r13131  
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
     12
     13/**
     14 * Is the Admin User's community profile enabled?
     15 *
     16 * @since 10.0.0
     17 *
     18 * @return bool True if enabled. False otherwise.
     19 */
     20function bp_members_is_community_profile_enabled() {
     21    /**
     22     * Filter here to disable the Admin User's Community profile.
     23     *
     24     * @since 10.0.0
     25     *
     26     * @param bool $value By default the Admin User's Community profile is enabled.
     27     */
     28    return apply_filters( 'bp_members_is_community_profile_enabled', true );
     29}
    1230
    1331// Load the BP Members admin.
Note: See TracChangeset for help on using the changeset viewer.