bp_document_forums_embed_attachments( $content, $id )
Embed topic or reply attachments in a post.
Description
Parameters
- $content
-
(Required)
- $id
-
(Required)
Return
(string)
Source
File: bp-document/bp-document-filters.php
function bp_document_forums_embed_attachments( $content, $id ) {
// Do not embed attachment in wp-admin area.
if ( is_admin() ) {
return $content;
}
$document_ids = get_post_meta( $id, 'bp_document_ids', true );
if ( ! empty( $document_ids ) && bp_has_document(
array(
'include' => $document_ids,
'order_by' => 'menu_order',
'sort' => 'ASC',
'privacy' => array( 'forums' ),
)
) ) {
ob_start();
?>
<div class="bb-activity-media-wrap forums-media-wrap">
<?php
while ( bp_document() ) {
bp_the_document();
bp_get_template_part( 'document/activity-entry' );
}
?>
</div>
<?php
$content .= ob_get_clean();
}
return $content;
}
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.