Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/15/2015 03:59:23 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Moderators: First pass at per-forum moderators.

This commit introduces a powerful feature commonly found in other popular forum software that has been on our wishlist for nearly 9 years. It includes the following changes:

  • Custom forum-mod taxonomy for assigning user nicenames to forum IDs
  • Associated functions for defining capabilities, labels, etc...
  • New capability filters for ensuring forum moderators have the ability to moderate forums even without the moderator role assignment
  • New option for toggling the entire feature on/off (on by default)

Props jmdodd, netweb. See #459.

File:
1 edited

Legend:

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

    r5770 r5834  
    1313/**
    1414 * Get the default site options and their values.
    15  * 
     15 *
    1616 * These option
    1717 *
     
    3838        '_bbp_allow_revisions'        => 1,                          // Allow revisions
    3939        '_bbp_allow_topic_tags'       => 1,                          // Allow topic tagging
     40        '_bbp_allow_forum_mods'       => 1,                          // Allow per-forum moderation
    4041        '_bbp_allow_threaded_replies' => 0,                          // Allow threaded replies
    4142        '_bbp_allow_search'           => 1,                          // Allow forum-wide search
     
    233234function bbp_allow_topic_tags( $default = 1 ) {
    234235    return (bool) apply_filters( 'bbp_allow_topic_tags', (bool) get_option( '_bbp_allow_topic_tags', $default ) );
     236}
     237
     238/**
     239 * Are per-forum moderators allowed
     240 *
     241 * @since bbPress (r5834)
     242 *
     243 * @param bool $default Optional. Default value true.
     244 * @uses get_option() To get the allow per-forum moderators
     245 *
     246 * @return bool Are per-forum moderators allowed?
     247 */
     248function bbp_allow_forum_mods( $default = 1 ) {
     249    return (bool) apply_filters( 'bbp_allow_forum_mods', (bool) get_option( '_bbp_allow_forum_mods', $default ) );
    235250}
    236251
Note: See TracChangeset for help on using the changeset viewer.