Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ntwb
Created December 19, 2013 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntwb/8037110 to your computer and use it in GitHub Desktop.
Save ntwb/8037110 to your computer and use it in GitHub Desktop.
bbPress - Custum Search Results
<?php
/*
Plugin Name: bbPress - Custum Search Results
Plugin URI: https://gist.github.com/ntwb/8037110
Description: bbPress - Custum Search Results
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
add_filter ( 'bbp_before_has_search_results_parse_args', ntwb_bbpress_custom_search_results);
function ntwb_bbpress_custom_search_results() {
$default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );
$args['post_type'] = $default_post_type;
$args['orderby'] = 'date';
$args['ignore_sticky_posts'] = 'false';
$args['order'] = 'DESC';
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment