Changeset 4971
- Timestamp:
- 05/28/2013 11:12:36 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
includes/admin/settings.php (modified) (4 diffs)
-
includes/common/shortcodes.php (modified) (2 diffs)
-
includes/common/template-tags.php (modified) (2 diffs)
-
includes/common/widgets.php (modified) (1 diff)
-
includes/core/options.php (modified) (2 diffs)
-
templates/default/bbpress/content-archive-forum.php (modified) (1 diff)
-
templates/default/bbpress/content-archive-topic.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/settings.php
r4969 r4971 85 85 /** User Section ******************************************************/ 86 86 87 'bbp_settings_user ' => array(87 'bbp_settings_users' => array( 88 88 89 89 // Edit lock setting … … 158 158 'title' => __( 'Topic tags', 'bbpress' ), 159 159 'callback' => 'bbp_admin_setting_callback_topic_tags', 160 'sanitize_callback' => 'intval', 161 'args' => array() 162 ), 163 164 // Allow topic tags 165 '_bbp_allow_search' => array( 166 'title' => __( 'Search', 'bbpress' ), 167 'callback' => 'bbp_admin_setting_callback_search', 160 168 'sanitize_callback' => 'intval', 161 169 'args' => array() … … 178 186 ), 179 187 180 // Allow threadde replies181 '_bbp_allow_threaded_replies' => array(182 'sanitize_callback' => 'intval',183 'args' => array()184 ),185 186 188 // Set reply threading level 187 189 '_bbp_thread_replies_depth' => array( 188 190 'title' => __( 'Reply Threading', 'bbpress' ), 189 191 'callback' => 'bbp_admin_setting_callback_thread_replies_depth', 192 'sanitize_callback' => 'intval', 193 'args' => array() 194 ), 195 196 // Allow threadde replies 197 '_bbp_allow_threaded_replies' => array( 190 198 'sanitize_callback' => 'intval', 191 199 'args' => array() … … 588 596 <input id="_bbp_allow_topic_tags" name="_bbp_allow_topic_tags" type="checkbox" id="_bbp_allow_topic_tags" value="1" <?php checked( bbp_allow_topic_tags( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_topic_tags' ); ?> /> 589 597 <label for="_bbp_allow_topic_tags"><?php esc_html_e( 'Allow topics to have tags', 'bbpress' ); ?></label> 598 599 <?php 600 } 601 602 /** 603 * Allow forum wide search 604 * 605 * @since bbPress (r4970) 606 * 607 * @uses checked() To display the checked attribute 608 */ 609 function bbp_admin_setting_callback_search() { 610 ?> 611 612 <input id="_bbp_allow_search" name="_bbp_allow_search" type="checkbox" id="_bbp_allow_search" value="1" <?php checked( bbp_allow_search( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_search' ); ?> /> 613 <label for="_bbp_allow_search"><?php esc_html_e( 'Allow forum wide search', 'bbpress' ); ?></label> 590 614 591 615 <?php -
trunk/includes/common/shortcodes.php
r4917 r4971 621 621 public function display_search_form() { 622 622 623 // Bail if search is disabled 624 if ( ! bbp_allow_search() ) { 625 return; 626 } 627 623 628 // Start output buffer 624 629 $this->start( 'bbp_search_form' ); … … 645 650 646 651 // Sanity check required info 647 if ( !empty( $content ) ) 652 if ( !empty( $content ) ) { 648 653 return $content; 654 } 655 656 // Bail if search is disabled 657 if ( ! bbp_allow_search() ) { 658 return; 659 } 649 660 650 661 // Trim search attribute if it's set -
trunk/includes/common/template-tags.php
r4953 r4971 795 795 global $wp_query; 796 796 797 // Bail if search is disabled 798 if ( ! bbp_allow_search() ) 799 return false; 800 797 801 // Assume false 798 802 $retval = false; … … 824 828 function bbp_is_search_results() { 825 829 global $wp_query; 830 831 // Bail if search is disabled 832 if ( ! bbp_allow_search() ) 833 return false; 826 834 827 835 // Assume false -
trunk/includes/common/widgets.php
r4948 r4971 408 408 */ 409 409 public function widget( $args, $instance ) { 410 411 // Bail if search is disabled 412 if ( ! bbp_allow_search() ) 413 return; 410 414 411 415 // Get widget settings -
trunk/includes/core/options.php
r4963 r4971 37 37 '_bbp_allow_global_access' => 1, // Users from all sites can post 38 38 '_bbp_allow_revisions' => 1, // Allow revisions 39 '_bbp_allow_topic_tags' => 1, // Topic Tags39 '_bbp_allow_topic_tags' => 1, // Allow topic tagging 40 40 '_bbp_allow_threaded_replies' => 0, // Allow threaded replies 41 '_bbp_allow_search' => 1, // Allow forum-wide search 41 42 '_bbp_thread_replies_depth' => 2, // Thread replies depth 42 43 '_bbp_use_wp_editor' => 1, // Use the WordPress editor if available … … 228 229 function bbp_allow_topic_tags( $default = 1 ) { 229 230 return (bool) apply_filters( 'bbp_allow_topic_tags', (bool) get_option( '_bbp_allow_topic_tags', $default ) ); 231 } 232 233 /** 234 * Is forum-wide searching allowed 235 * 236 * @since bbPress (r4970) 237 * @param $default bool Optional. Default value true 238 * @uses get_option() To get the forum-wide search setting 239 * @return bool Is forum-wide searching allowed? 240 */ 241 function bbp_allow_search( $default = 1 ) { 242 return (bool) apply_filters( 'bbp_allow_search', (bool) get_option( '_bbp_allow_search', $default ) ); 230 243 } 231 244 -
trunk/templates/default/bbpress/content-archive-forum.php
r4733 r4971 12 12 <div id="bbpress-forums"> 13 13 14 < div class="bbp-search-form">14 <?php if ( bbp_allow_search() ) : ?> 15 15 16 < ?php bbp_get_template_part( 'form', 'search' ); ?>16 <div class="bbp-search-form"> 17 17 18 </div> 18 <?php bbp_get_template_part( 'form', 'search' ); ?> 19 20 </div> 21 22 <?php endif; ?> 19 23 20 24 <?php bbp_breadcrumb(); ?> -
trunk/templates/default/bbpress/content-archive-topic.php
r4733 r4971 11 11 12 12 <div id="bbpress-forums"> 13 14 <?php if ( bbp_allow_search() ) : ?> 15 16 <div class="bbp-search-form"> 17 18 <?php bbp_get_template_part( 'form', 'search' ); ?> 19 20 </div> 21 22 <?php endif; ?> 13 23 14 24 <?php bbp_breadcrumb(); ?>
Note: See TracChangeset
for help on using the changeset viewer.