bp_restrict_single_attachment()

Restrict user when visit attachment url from media/document.

Description

  • Privacy security.

Source

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

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
function bp_restrict_single_attachment() {
    if ( is_attachment() ) {
        global $post;
        if ( ! empty( $post ) ) {
            $media_meta    = get_post_meta( $post->ID, 'bp_media_upload', true );
            $document_meta = get_post_meta( $post->ID, 'bp_document_upload', true );
            if (
                ! empty( $media_meta ) ||
                ! empty( $document_meta )
            ) {
                bp_do_404();
                return;
            }
        }
    }
}

Changelog

Changelog
Version Description
BuddyBoss 1.5.5 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.