Quantcast
Channel: bbPress.org » All Posts
Viewing all articles
Browse latest Browse all 3638

Reply To: Search only topics not forum / replies

$
0
0

Hmph… okay… I’ve noticed that /plugins/bbpress/includes/search/template.php is actually responsible for that feature:


function bbp_has_search_results( $args = '' ) {
	global $wp_rewrite;

	/** Defaults **************************************************************/

	$default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );

	// Default query args
	$default = array(
		'post_type'           => $default_post_type,         // Forums, topics, and replies
		'posts_per_page'      => bbp_get_replies_per_page(), // This many
		'paged'               => bbp_get_paged(),            // On this page
		'orderby'             => 'date',                     // Sorted by date
		'order'               => 'DESC',                     // Most recent first
		'ignore_sticky_posts' => true,                       // Stickies not supported
		's'                   => bbp_get_search_terms(),     // This is a search
	);

So, changing ‘post_type’ => $default_post_type to ‘post_type’ => bbp_get_topic_post_type() works. However, it’s not clearly the best practice to modify the plugin directly anyother way to override this?


Viewing all articles
Browse latest Browse all 3638

Trending Articles