bp_document_activity_entry()

Get activity entry document to render on front end

Description

Source

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

function bp_document_activity_entry() {

	$document_ids = bp_activity_get_meta( bp_get_activity_id(), 'bp_document_ids', true );

	// Add document to single activity page.
	$document_activity = bp_activity_get_meta( bp_get_activity_id(), 'bp_document_activity', true );
	if ( bp_is_single_activity() && ! empty( $document_activity ) && '1' === $document_activity && empty( $document_ids ) ) {
		$document_ids = BP_Document::get_activity_document_id( bp_get_activity_id() );
	}

	if ( ! empty( $document_ids ) && bp_has_document(
		array(
			'include'  => $document_ids,
			'order_by' => 'menu_order',
			'sort'     => 'ASC',
		)
	) ) { ?>
		<div class="bb-activity-media-wrap bb-media-length-1 ">
			<?php

			bp_get_template_part( 'document/activity-document-move' );
			while ( bp_document() ) {
				bp_the_document();
				bp_get_template_part( 'document/activity-entry' );
			}
			?>
		</div>
		<?php
	}
}

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.