Skip to:
Content

bbPress.org

Changeset 6630


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.

Location:
trunk/src/templates/default/bbpress
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/templates/default/bbpress/content-archive-forum.php

    r6258 r6630  
    1515<div id="bbpress-forums" class="bbpress-wrapper">
    1616
    17     <?php if ( bbp_allow_search() ) : ?>
    18 
    19         <div class="bbp-search-form">
    20 
    21             <?php bbp_get_template_part( 'form', 'search' ); ?>
    22 
    23         </div>
    24 
    25     <?php endif; ?>
     17    <?php bbp_get_template_part( 'form', 'search' ); ?>
    2618
    2719    <?php bbp_breadcrumb(); ?>
  • 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;
  • 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;
  • trunk/src/templates/default/bbpress/form-topic-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-topic-search-form">
    16     <div>
    17         <label class="screen-reader-text hidden" for="ts"><?php esc_html_e( 'Search topics:', 'bbpress' ); ?></label>
    18         <input type="text" value="<?php bbp_search_terms(); ?>" name="ts" id="ts" />
    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-topic-search-form">
     17            <div>
     18                <label class="screen-reader-text hidden" for="ts"><?php esc_html_e( 'Search topics:', 'bbpress' ); ?></label>
     19                <input type="text" value="<?php bbp_search_terms(); ?>" name="ts" id="ts" />
     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;
  • trunk/src/templates/default/bbpress/user-engagements.php

    r6623 r6630  
    1515<div id="bbp-user-engagements" class="bbp-user-engagements">
    1616
    17     <?php if ( bbp_allow_search() ) : ?>
    18 
    19         <div class="bbp-search-form">
    20 
    21             <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    22 
    23         </div>
    24 
    25     <?php endif; ?>
     17    <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    2618
    2719    <h2 class="entry-title"><?php esc_html_e( 'Topics Engaged In', 'bbpress' ); ?></h2>
  • trunk/src/templates/default/bbpress/user-favorites.php

    r6623 r6630  
    1515<div id="bbp-user-favorites" class="bbp-user-favorites">
    1616
    17     <?php if ( bbp_allow_search() ) : ?>
    18 
    19         <div class="bbp-search-form">
    20 
    21             <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    22 
    23         </div>
    24 
    25     <?php endif; ?>
     17    <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    2618
    2719    <h2 class="entry-title"><?php esc_html_e( 'Favorite Forum Topics', 'bbpress' ); ?></h2>
  • trunk/src/templates/default/bbpress/user-replies-created.php

    r6623 r6630  
    1515<div id="bbp-user-replies-created" class="bbp-user-replies-created">
    1616
    17     <?php if ( bbp_allow_search() ) : ?>
    18 
    19         <div class="bbp-search-form">
    20 
    21             <?php bbp_get_template_part( 'form', 'reply-search' ); ?>
    22 
    23         </div>
    24 
    25     <?php endif; ?>
     17    <?php bbp_get_template_part( 'form', 'reply-search' ); ?>
    2618
    2719    <h2 class="entry-title"><?php esc_html_e( 'Forum Replies Created', 'bbpress' ); ?></h2>
  • trunk/src/templates/default/bbpress/user-subscriptions.php

    r6623 r6630  
    1919        <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">
    2020
    21             <?php if ( bbp_allow_search() ) : ?>
    22 
    23                 <div class="bbp-search-form">
    24 
    25                     <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    26 
    27                 </div>
    28 
    29             <?php endif; ?>
     21            <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    3022
    3123            <h2 class="entry-title"><?php esc_html_e( 'Subscribed Forums', 'bbpress' ); ?></h2>
  • trunk/src/templates/default/bbpress/user-topics-created.php

    r6623 r6630  
    1515<div id="bbp-user-topics-started" class="bbp-user-topics-started">
    1616
    17     <?php if ( bbp_allow_search() ) : ?>
    18 
    19         <div class="bbp-search-form">
    20 
    21             <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    22 
    23         </div>
    24 
    25     <?php endif; ?>
     17    <?php bbp_get_template_part( 'form', 'topic-search' ); ?>
    2618
    2719    <h2 class="entry-title"><?php esc_html_e( 'Forum Topics Started', 'bbpress' ); ?></h2>
Note: See TracChangeset for help on using the changeset viewer.