Skip to:
Content

bbPress.org

Changeset 4067


Ignore:
Timestamp:
07/07/2012 04:24:49 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Settings:

  • Use integers in bbp_get_default_options() and friends, to avoid boolean conflict in get_option().
  • See r4065.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-options.php

    r4065 r4067  
    3030        /** Settings **********************************************************/
    3131
    32         '_bbp_edit_lock'            => '5',         // Lock post editing after 5 minutes
    33         '_bbp_throttle_time'        => '10',        // Throttle post time to 10 seconds
    34         '_bbp_enable_favorites'     => true,        // Favorites
    35         '_bbp_enable_subscriptions' => true,        // Subscriptions
    36         '_bbp_allow_anonymous'      => false,       // Allow anonymous posting
    37         '_bbp_allow_global_access'  => false,       // Users from all sites can post
    38         '_bbp_use_wp_editor'        => true,        // Use the WordPress editor if available
    39         '_bbp_use_autoembed'        => false,       // Allow oEmbed in topics and replies
     32        '_bbp_edit_lock'            => 5,           // Lock post editing after 5 minutes
     33        '_bbp_throttle_time'        => 10,          // Throttle post time to 10 seconds
     34        '_bbp_enable_favorites'     => 1,           // Favorites
     35        '_bbp_enable_subscriptions' => 1,           // Subscriptions
     36        '_bbp_allow_anonymous'      => 0,           // Allow anonymous posting
     37        '_bbp_allow_global_access'  => 0,           // Users from all sites can post
     38        '_bbp_use_wp_editor'        => 1,           // Use the WordPress editor if available
     39        '_bbp_use_autoembed'        => 0,           // Allow oEmbed in topics and replies
    4040        '_bbp_theme_package_id'     => 'default',   // The ID for the current theme packag.
    4141
    4242        /** Per Page **********************************************************/
    4343
    44         '_bbp_topics_per_page'      => '15',        // Topics per page
    45         '_bbp_replies_per_page'     => '15',        // Replies per page
    46         '_bbp_forums_per_page'      => '50',        // Forums per page
    47         '_bbp_topics_per_rss_page'  => '25',        // Topics per RSS page
    48         '_bbp_replies_per_rss_page' => '25',        // Replies per RSS page
     44        '_bbp_topics_per_page'      => 15,          // Topics per page
     45        '_bbp_replies_per_page'     => 15,          // Replies per page
     46        '_bbp_forums_per_page'      => 50,          // Forums per page
     47        '_bbp_topics_per_rss_page'  => 25,          // Topics per RSS page
     48        '_bbp_replies_per_rss_page' => 25,          // Replies per RSS page
    4949
    5050        /** Page For **********************************************************/
    5151
    52         '_bbp_page_for_forums'      => '0',         // Page for forums
    53         '_bbp_page_for_topics'      => '0',         // Page for forums
    54         '_bbp_page_for_login'       => '0',         // Page for login
    55         '_bbp_page_for_register'    => '0',         // Page for register
    56         '_bbp_page_for_lost_pass'   => '0',         // Page for lost-pass
     52        '_bbp_page_for_forums'      => 0,           // Page for forums
     53        '_bbp_page_for_topics'      => 0,           // Page for forums
     54        '_bbp_page_for_login'       => 0,           // Page for login
     55        '_bbp_page_for_register'    => 0,           // Page for register
     56        '_bbp_page_for_lost_pass'   => 0,           // Page for lost-pass
    5757
    5858        /** Archive Slugs *****************************************************/
     
    6363        /** Single Slugs ******************************************************/
    6464
    65         '_bbp_include_root'         => true,        // Include forum-archive before single slugs
     65        '_bbp_include_root'         => 1,           // Include forum-archive before single slugs
    6666        '_bbp_forum_slug'           => 'forum',     // Forum slug
    6767        '_bbp_topic_slug'           => 'topic',     // Topic slug
     
    7676        /** Topics ************************************************************/
    7777
    78         '_bbp_title_max_length'     => '80',        // Title Max Length
     78        '_bbp_title_max_length'     => 80,          // Title Max Length
    7979        '_bbp_super_sticky_topics'  => '',          // Super stickies
    8080
     
    8686        /** BuddyPress ********************************************************/
    8787
    88         '_bbp_enable_group_forums'  => true,        // Enable BuddyPress Group Extension
    89         '_bbp_group_forums_root_id' => '0',         // Group Forums parent forum id
     88        '_bbp_enable_group_forums'  => 1,           // Enable BuddyPress Group Extension
     89        '_bbp_group_forums_root_id' => 0,           // Group Forums parent forum id
    9090
    9191        /** Akismet ***********************************************************/
    9292
    93         '_bbp_enable_akismet'       => true         // Users from all sites can post
     93        '_bbp_enable_akismet'       => 1            // Users from all sites can post
    9494
    9595    ) );
     
    165165 * @return mixed false if not overloaded, mixed if set
    166166 */
    167 function bbp_pre_get_option( $value = false ) {
     167function bbp_pre_get_option( $value = '' ) {
    168168    $bbp = bbpress();
    169169
     
    189189 * @return bool Is favorites enabled or not
    190190 */
    191 function bbp_is_favorites_active( $default = true ) {
     191function bbp_is_favorites_active( $default = 1 ) {
    192192    return (bool) apply_filters( 'bbp_is_favorites_active', (bool) get_option( '_bbp_enable_favorites', $default ) );
    193193}
     
    201201 * @return bool Is subscription enabled or not
    202202 */
    203 function bbp_is_subscriptions_active( $default = true ) {
     203function bbp_is_subscriptions_active( $default = 1 ) {
    204204    return (bool) apply_filters( 'bbp_is_subscriptions_active', (bool) get_option( '_bbp_enable_subscriptions', $default ) );
    205205}
     
    213213 * @return bool Are revisions allowed?
    214214 */
    215 function bbp_allow_revisions( $default = true ) {
     215function bbp_allow_revisions( $default = 1 ) {
    216216    return (bool) apply_filters( 'bbp_allow_revisions', (bool) get_option( '_bbp_allow_revisions', $default ) );
    217217}
     
    225225 * @return bool Is anonymous posting allowed?
    226226 */
    227 function bbp_allow_anonymous( $default = false ) {
     227function bbp_allow_anonymous( $default = 0 ) {
    228228    return apply_filters( 'bbp_allow_anonymous', (bool) get_option( '_bbp_allow_anonymous', $default ) );
    229229}
     
    237237 * @return bool Is global access allowed?
    238238 */
    239 function bbp_allow_global_access( $default = false ) {
     239function bbp_allow_global_access( $default = 0 ) {
    240240    return (bool) apply_filters( 'bbp_allow_global_access', (bool) get_option( '_bbp_allow_global_access', $default ) );
    241241}
     
    249249 * @return bool Use WP editor?
    250250 */
    251 function bbp_use_wp_editor( $default = true ) {
     251function bbp_use_wp_editor( $default = 1 ) {
    252252    return (bool) apply_filters( 'bbp_use_wp_editor', (bool) get_option( '_bbp_use_wp_editor', $default ) );
    253253}
     
    261261 * @return bool Use oEmbed?
    262262 */
    263 function bbp_use_autoembed( $default = true ) {
     263function bbp_use_autoembed( $default = 1 ) {
    264264    return (bool) apply_filters( 'bbp_use_autoembed', (bool) get_option( '_bbp_use_autoembed', $default ) );
    265265}
     
    283283 * @param $default bool Optional. Default value 80
    284284 */
    285 function bbp_title_max_length( $default = '80' ) {
     285function bbp_title_max_length( $default = 80 ) {
    286286    echo bbp_get_title_max_length( $default );
    287287}
     
    294294     * @return int Is anonymous posting allowed?
    295295     */
    296     function bbp_get_title_max_length( $default = '80' ) {
     296    function bbp_get_title_max_length( $default = 80 ) {
    297297        return (int) apply_filters( 'bbp_get_title_max_length', (int) get_option( '_bbp_title_max_length', $default ) );
    298298    }
     
    302302 *
    303303 * @since bbPress (r3575)
    304  * @param $default bool Optional. Default value
    305  */
    306 function bbp_group_forums_root_id( $default = '0' ) {
     304 * @param $default int Optional. Default value
     305 */
     306function bbp_group_forums_root_id( $default = 0 ) {
    307307    echo bbp_get_group_forums_root_id( $default );
    308308}
     
    312312     * @since bbPress (r3575)
    313313     * @param $default bool Optional. Default value 0
    314      * @uses get_option() To get the maximum title length
    315      * @return int Is anonymous posting allowed?
     314     * @uses get_option() To get the root group forum ID
     315     * @return int The post ID for the root forum
    316316     */
    317     function bbp_get_group_forums_root_id( $default = '0' ) {
     317    function bbp_get_group_forums_root_id( $default = 0 ) {
    318318        return (int) apply_filters( 'bbp_get_group_forums_root_id', (int) get_option( '_bbp_group_forums_root_id', $default ) );
    319319    }
     
    327327 * @return bool Is group forums enabled or not
    328328 */
    329 function bbp_is_group_forums_active( $default = true ) {
     329function bbp_is_group_forums_active( $default = 1 ) {
    330330    return (bool) apply_filters( 'bbp_is_group_forums_active', (bool) get_option( '_bbp_enable_group_forums', $default ) );
    331331}
     
    339339 * @return bool Is Akismet enabled or not
    340340 */
    341 function bbp_is_akismet_active( $default = true ) {
     341function bbp_is_akismet_active( $default = 1 ) {
    342342    return (bool) apply_filters( 'bbp_is_akismet_active', (bool) get_option( '_bbp_enable_akismet', $default ) );
    343343}
     
    359359 *
    360360 * @since bbPress (r3759)
    361  * @return string
    362  */
    363 function bbp_include_root_slug( $default = true ) {
     361 * @return bool
     362 */
     363function bbp_include_root_slug( $default = 1 ) {
    364364    return (bool) apply_filters( 'bbp_include_root_slug', (bool) get_option( '_bbp_include_root', $default ) );
    365365}
Note: See TracChangeset for help on using the changeset viewer.