bp_attachments_cover_image_is_edit()

Are we on a page to edit a cover photo?

Description

Return

(bool) True if on a page to edit a cover photo, false otherwise.

Source

File: bp-core/bp-core-attachments.php

1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
function bp_attachments_cover_image_is_edit() {
    $retval = false;
 
    $current_component = bp_current_component();
    if ( bp_is_active( 'xprofile' ) && bp_is_current_component( 'xprofile' ) ) {
        $current_component = 'xprofile';
    }
 
    if ( ! bp_is_active( $current_component, 'cover_image' ) ) {
        return $retval;
    }
 
    if ( bp_is_user_change_cover_image() ) {
        $retval = ! bp_disable_cover_image_uploads();
    }
 
    if ( ( bp_is_group_admin_page() && 'group-cover-image' == bp_get_group_current_admin_tab() )
        || ( bp_is_group_create() && bp_is_group_creation_step( 'group-cover-image' ) ) ) {
        $retval = ! bp_disable_group_cover_image_uploads();
    }
 
    return apply_filters( 'bp_attachments_cover_image_is_edit', $retval, $current_component );
}

Changelog

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