Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/19/2017 05:23:30 PM (8 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-search.php

    r6622 r6630  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 ?>
     13if ( bbp_allow_search() ) : ?>
    1414
    15 <form role="search" method="get" id="bbp-search-form" action="<?php bbp_search_url(); ?>">
    16     <div>
    17         <label class="screen-reader-text hidden" for="bbp_search"><?php esc_html_e( 'Search for:', 'bbpress' ); ?></label>
    18         <input type="hidden" name="action" value="bbp-search-request" />
    19         <input type="text" value="<?php bbp_search_terms(); ?>" name="bbp_search" id="bbp_search" />
    20         <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-search-form" action="<?php bbp_search_url(); ?>">
     17            <div>
     18                <label class="screen-reader-text hidden" for="bbp_search"><?php esc_html_e( 'Search for:', 'bbpress' ); ?></label>
     19                <input type="hidden" name="action" value="bbp-search-request" />
     20                <input type="text" value="<?php bbp_search_terms(); ?>" name="bbp_search" id="bbp_search" />
     21                <input class="button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>" />
     22            </div>
     23        </form>
    2124    </div>
    22 </form>
     25
     26<?php endif;
Note: See TracChangeset for help on using the changeset viewer.