If you’ve arrived at this post, then you’ve probably been via a thread on the support pages of the ‘bbPress Topics for Posts’ plugin
The ‘bbPress Topics for Posts’ plugin was not written by me, but following release of WordPress 5.x the plugin stopped working due to the revised way that ‘Gutenberg’ handles posts, and as the author was no longer maintaining, I managed to get contributor rights to the plugin, and spent just long enough to get it working again.
I don’t intend to spend time in developing this plugin, but will try to maintain.
Several people have asked how to add custom post types to the plugin.
Art a basic level, this is simply achieved by this code
// add custom post_types to bbpress topics for posts plugin
add_filter( 'bbppt_eligible_post_types', 'bbppt_add_post_types');
function bbppt_add_post_types ($content) {
array_push($content, 'custom-post-type-1', 'custom-post-type-2'); // add extra post_types here
return $content;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Amended File
1. kaon68
kaon68 in this thread https://wordpress.org/support/topic/custom-post-forum-filter-by-custom-post/ has amended my file to add a custom post type within the code, but also to add a customisation field for topic title and auto subscription to reply for post author
I post the amended file merely to help others, the changes are too complex to easily add to the plugin via filters and actions.
2. josett225
Jose sent me this file, which incorporates the ‘event’ custom post type
I am working in integrating this into my plugin, so that with a litlle extra code, any custom post type can be added