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/core/options.php

    r4963 r4971  
    3737        '_bbp_allow_global_access'    => 1,                          // Users from all sites can post
    3838        '_bbp_allow_revisions'        => 1,                          // Allow revisions
    39         '_bbp_allow_topic_tags'       => 1,                          // Topic Tags
     39        '_bbp_allow_topic_tags'       => 1,                          // Allow topic tagging
    4040        '_bbp_allow_threaded_replies' => 0,                          // Allow threaded replies
     41        '_bbp_allow_search'           => 1,                          // Allow forum-wide search
    4142        '_bbp_thread_replies_depth'   => 2,                          // Thread replies depth
    4243        '_bbp_use_wp_editor'          => 1,                          // Use the WordPress editor if available
     
    228229function bbp_allow_topic_tags( $default = 1 ) {
    229230    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 */
     241function bbp_allow_search( $default = 1 ) {
     242    return (bool) apply_filters( 'bbp_allow_search', (bool) get_option( '_bbp_allow_search', $default ) );
    230243}
    231244
Note: See TracChangeset for help on using the changeset viewer.