Skip to:
Content

bbPress.org

Changeset 4294


Ignore:
Timestamp:
11/02/2012 07:29:22 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Introduce bbp_get_default_role() in core/options.php and set default option value.
  • See #1939.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/options.php

    r4249 r4294  
    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'     => 1,           // Favorites
    35         '_bbp_enable_subscriptions' => 1,           // Subscriptions
    36         '_bbp_allow_topic_tags'     => 1,           // Topic Tags
    37         '_bbp_allow_anonymous'      => 0,           // Allow anonymous posting
    38         '_bbp_allow_global_access'  => 0,           // Users from all sites can post
    39         '_bbp_use_wp_editor'        => 1,           // Use the WordPress editor if available
    40         '_bbp_use_autoembed'        => 0,           // Allow oEmbed in topics and replies
    41         '_bbp_theme_package_id'     => 'default',   // The ID for the current theme packag.
     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_topic_tags'     => 1,                          // Topic Tags
     37        '_bbp_allow_anonymous'      => 0,                          // Allow anonymous posting
     38        '_bbp_allow_global_access'  => 0,                          // Users from all sites can post
     39        '_bbp_use_wp_editor'        => 1,                          // Use the WordPress editor if available
     40        '_bbp_use_autoembed'        => 0,                          // Allow oEmbed in topics and replies
     41        '_bbp_theme_package_id'     => 'default',                  // The ID for the current theme package.
     42        '_bbp_default_role'         => bbp_get_participant_role(), // Default forums role
    4243
    4344        /** Per Page **********************************************************/
     
    256257function bbp_allow_global_access( $default = 0 ) {
    257258    return (bool) apply_filters( 'bbp_allow_global_access', (bool) get_option( '_bbp_allow_global_access', $default ) );
     259}
     260
     261/**
     262 * Is this forum available to all users on all sites in this installation?
     263 *
     264 * @since bbPress (r4294)
     265 * @param $default string Optional. Default value empty
     266 * @uses get_option() To get the default forums role option
     267 * @return string The default forums user role
     268 */
     269function bbp_get_default_role( $default = 'bbp_participant' ) {
     270    return apply_filters( 'bbp_get_default_role', get_option( '_bbp_default_role', $default ) );
    258271}
    259272
Note: See TracChangeset for help on using the changeset viewer.