bp_core_can_edit_settings()

Check whether the logged-in user can edit settings for the displayed user.

Description

Return

(bool) True if editing is allowed, otherwise false.

Source

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

1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
function bp_core_can_edit_settings() {
    $status = false;
 
    if ( bp_is_my_profile() ) {
        $status = true;
    } elseif ( bp_is_user() && ! bp_is_my_profile() ) {
        $status = false;
    } elseif ( is_super_admin( bp_displayed_user_id() ) && ! is_super_admin() ) {
        $status = false;
    } elseif ( bp_current_user_can( 'bp_moderate' ) || current_user_can( 'edit_users' ) ) {
        $status = true;
    }
 
    /**
     * Filters the status of whether the logged-in user can edit settings for the displayed user or not.
     *
     * @since BuddyPress 2.8.0
     *
     * @param bool True if editing is allowed, otherwise false.
     */
    return apply_filters( 'bp_core_can_edit_settings', $status );
}

Changelog

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