bp_media_activity_append_media( $content,  $activity )

Append the media content to activity read more content

Description

Parameters

$content

(Required)

$activity

(Required)

Return

(string)

Source

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

function bp_media_activity_append_media( $content, $activity ) {
	global $media_template;
	$media_ids = bp_activity_get_meta( $activity->id, 'bp_media_ids', true );

	if ( ! empty( $media_ids ) && bp_has_media( array( 'include' => $media_ids, 'order_by' => 'menu_order', 'sort' => 'ASC' ) ) ) { ?>
        <?php ob_start(); ?>
        <div class="bb-activity-media-wrap <?php echo 'bb-media-length-' . $media_template->media_count; echo $media_template->media_count > 5 ? ' bb-media-length-more' : ''; ?>"><?php
		while ( bp_media() ) {
			bp_the_media();
			bp_get_template_part( 'media/activity-entry' );
		} ?>
        </div><?php
		$content .= ob_get_clean();
	}
	return $content;
}

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.