Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/16/2012 08:19:21 AM (13 years ago)
Author:
jmdodd
Message:

Introduce dedicated forum search.

  • Search forums, topics, and replies.
  • Add new search functions, including bbp_has_search_results().
  • Provide templates for search results.
  • Fixes #1575.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/template-loader.php

    r4522 r4579  
    3131 * @uses bbp_is_single_view() To check if page is single view
    3232 * @uses bbp_get_single_view_template() To get view template
     33 * @uses bbp_is_search() To check if page is search
     34 * @uses bbp_get_search_template() To get search template
    3335 * @uses bbp_is_forum_edit() To check if page is forum edit
    3436 * @uses bbp_get_forum_edit_template() To get forum edit template
     
    6466    elseif ( bbp_is_single_view()      && ( $new_template = bbp_get_single_view_template()      ) ) :
    6567
     68    // Search
     69    elseif ( bbp_is_search()           && ( $new_template = bbp_get_search_template()           ) ) :
     70
    6671    // Forum edit
    6772    elseif ( bbp_is_forum_edit()       && ( $new_template = bbp_get_forum_edit_template()       ) ) :
     
    249254    );
    250255    return bbp_get_query_template( 'single_view', $templates );
     256}
     257
     258/**
     259 * Get the search template
     260 *
     261 * @since bbPress (r4579)
     262 *
     263 * @uses bbp_get_query_template()
     264 * @return string Path to template file
     265 */
     266function bbp_get_search_template() {
     267    $templates = array(
     268        'page-forum-search.php', // Single Search
     269        'forum-search.php',      // Search
     270    );
     271    return bbp_get_query_template( 'single_search', $templates );
    251272}
    252273
Note: See TracChangeset for help on using the changeset viewer.