bp_document_get_specific( array|string $args = '' )

Fetch specific document items.

Description

See also

Parameters

$args

(array|string) (Optional) All arguments and defaults are shared with BP_Document::get(), except for the following

Default value: ''

Return

(array) $activity See BP_Document::get() for description.

Source

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

function bp_document_get_specific( $args = '' ) {

	$r = bp_parse_args(
		$args,
		array(
			'document_ids' => false,      // A single document_id or array of IDs.
			'max'          => false,      // Maximum number of results to return.
			'page'         => 1,          // Page 1 without a per_page will result in no pagination.
			'per_page'     => false,      // Results per page.
			'sort'         => 'DESC',     // Sort ASC or DESC.
			'order_by'     => false,      // Sort ASC or DESC.
			'folder_id'    => false,      // Sort ASC or DESC.
			'folder'       => false,
			'meta_query'   => false,
		),
		'document_get_specific'
	);

	$get_args = array(
		'in'         => $r['document_ids'],
		'max'        => $r['max'],
		'page'       => $r['page'],
		'per_page'   => $r['per_page'],
		'sort'       => $r['sort'],
		'order_by'   => $r['order_by'],
		'folder_id'  => $r['folder_id'],
		'folder'     => $r['folder'],
		'meta_query' => $r['meta_query'],
	);

	/**
	 * Filters the requested specific document item.
	 *
	 * @param BP_Document $document Requested document object.
	 * @param array       $args     Original passed in arguments.
	 * @param array       $get_args Constructed arguments used with request.
	 *
	 * @since BuddyBoss 1.4.0
	 */
	return apply_filters( 'bp_document_get_specific', BP_Document::get( $get_args ), $args, $get_args );
}

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.