BP_Document_Privacy::get_visibility( $document_id )

Get visibility of document

Description

Parameters

$document_id

(Required)

Return

(WP_Error)

Source

File: bp-document/classes/class-bp-document-privacy.php

	function get_visibility( $document_id ) {
		$result = bp_document_get_specific( array( 'document_ids' => $document_id ) );

		if ( empty( $result['documents'] ) || empty( $result['documents'][0] ) ) {
			return new WP_Error( 'no_document', __( 'There is no document.', 'buddyboss' ), array( 'status' => 500 ) );
		}

		return $result['documents'][0]->privacy;
	}

Changelog

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