Hi,
I am the author of the GD bbPress Attachments plugin, and you are right, there is no such feature. But, all files are in the media library, so you can create your own template for a theme that can pull files attached to topics and forums and display them.
A feature like that would be available in the GD bbPress Toolbox Pro plugin, most likely next month, but there are no plans to implement it in the free version.
Regards,
Milan
Thank you, thats really helpful!
I’ve been looking into this further, could you point me in the right direction for only displaying media files that are attached to Forum Topics/replies?
Thanks.
I can’t provide you with example code here (I don’t have anything written to use).
The easiest way to do this is with WP_Query for ‘attachment’ post type having ‘_bbp_attachment’ meta with value ‘1’.
Milan
Thank you, thats just the advice I needed!
ok, so far I have this code:
function display_attachments() {
$args = array(
'post_type' => 'attachment',
'post_status' => 'inherit',
'meta_query' => array(
array(
'key' => '_bbp_attachment',
'value' => '1'
)
)
);
$query = new WP_Query($args);
print_r($query);
}
add_shortcode( 'display_attachments', 'display_attachments' );
This appears to output the whole SQL query as well as the attachment url string. Can you help?
WP_Query doesn’t return the results, it is an object holding a lot of things, including the results. Check out how to use WP_Query for the loop, there are many examples on WordPress.org and elsewhere. And, results are also objects, so you need to create code to take the object and display the results.