not quite sure what you mean by ‘archived’ content
bbpress has statuses of
public,
private
closed
spam
trash
spam and trash depend on the user capability – so keymasters and moderators see these, but not participant level.
So how does one exclude the “closed” forums from bbpress search?
Thanks
‘closed’ in bbpress just means that the area cannot have new things added.
If you want to have an old forum that is not seen by users, then make it hidden.
Hi Robin,
We want it to be still visible, but we just want to exclude it from the search results. This is why I’m trying to figure out what to do with this filter: bbp_after_has_search_results_parse_args
Thanks!
untested, but this should do it
add_filter ('bbp_after_has_search_results_parse_args', 'my_function')
my_function ($args) {
// bbp_get_closed_status_id() REMOVED,
$post_statuses = array(
bbp_get_public_status_id(),
bbp_get_spam_status_id(),
bbp_get_trash_status_id()
);
// Add support for private status
if ( current_user_can( 'read_private_topics' ) ) {
$post_statuses[] = bbp_get_private_status_id();
}
// Join post statuses together
$args['post_status'] = implode( ',', $post_statuses );
return $args ;
}