Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/28/2013 11:12:36 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Allow the search feature to be toggled on and off. Introduces new setting and supporting function to get and override the option easily in third party plugins. Fixes #2342.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/settings.php

    r4969 r4971  
    8585                /** User Section ******************************************************/
    8686
    87                 'bbp_settings_user' => array(
     87                'bbp_settings_users' => array(
    8888
    8989                        // Edit lock setting
    … …  
    158158                                'title'             => __( 'Topic tags', 'bbpress' ),
    159159                                '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',
    160168                                'sanitize_callback' => 'intval',
    161169                                'args'              => array()
    … …  
    178186                        ),
    179187
    180                         // Allow threadde replies
    181                         '_bbp_allow_threaded_replies' => array(
    182                                 'sanitize_callback' => 'intval',
    183                                 'args'              => array()
    184                         ),
    185 
    186188                        // Set reply threading level
    187189                        '_bbp_thread_replies_depth' => array(
    188190                                'title'             => __( 'Reply Threading', 'bbpress' ),
    189191                                '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(
    190198                                'sanitize_callback' => 'intval',
    191199                                'args'              => array()
    … …  
    588596        <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' ); ?> />
    589597        <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 */
     609function 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>
    590614
    591615<?php
Note: See TracChangeset for help on using the changeset viewer.