Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/19/2017 05:23:30 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Search: move bbp_allow_search() checks into form template parts.

This allows the inclusion of those forms without needing to wrap each inclusion statement in its own feature check, making search a more atomic and isolated feature within bbPress.

It also should conclude the development of the user content search functionality.

Because this involves some template-part changes to the "Default" template pack, users who have opted to override these parts in their own themes will not receive these updates (nor should they.) This is a known consequence of including template parts in themes, so while still not an ideal system, will not result in any breakage for existing sites.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/templates/default/bbpress/form-reply-search.php

    r6623 r6630  
    22
    33/**
    4  * Search 
     4 * Search
    55 *
    66 * @package bbPress
     
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 ?>
     13if ( bbp_allow_search() ) : ?>
    1414
    15 <form role="search" method="get" id="bbp-reply-search-form">
    16     <div>
    17         <label class="screen-reader-text hidden" for="ts"><?php esc_html_e( 'Search replies:', 'bbpress' ); ?></label>
    18         <input type="text" value="<?php bbp_search_terms(); ?>" name="ts" id="rs" />
    19         <input class="button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>" />
     15    <div class="bbp-search-form">
     16        <form role="search" method="get" id="bbp-reply-search-form">
     17            <div>
     18                <label class="screen-reader-text hidden" for="rs"><?php esc_html_e( 'Search replies:', 'bbpress' ); ?></label>
     19                <input type="text" value="<?php bbp_search_terms(); ?>" name="rs" id="rs" />
     20                <input class="button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>" />
     21            </div>
     22        </form>
    2023    </div>
    21 </form>
     24
     25<?php endif;
Note: See TracChangeset for help on using the changeset viewer.