Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/15/2015 03:59:23 PM (9 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/admin/settings.php

    r5829 r5834  
    162162            ),
    163163
     164            // Allow per-forum moderators
     165            '_bbp_allow_forum_mods' => array(
     166                'title'             => __( 'Forum Moderators', 'bbpress' ),
     167                'callback'          => 'bbp_admin_setting_callback_forum_mods',
     168                'sanitize_callback' => 'intval',
     169                'args'              => array()
     170            ),
     171
    164172            // Allow topic tags
    165173            '_bbp_allow_search' => array(
     
    597605    <input name="_bbp_allow_topic_tags" id="_bbp_allow_topic_tags" type="checkbox" value="1" <?php checked( bbp_allow_topic_tags( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_topic_tags' ); ?> />
    598606    <label for="_bbp_allow_topic_tags"><?php esc_html_e( 'Allow topics to have tags', 'bbpress' ); ?></label>
     607
     608<?php
     609}
     610
     611/**
     612 * Allow forum-mods setting field
     613 *
     614 * @since bbPress (r5834)
     615 *
     616 * @uses checked() To display the checked attribute
     617 */
     618function bbp_admin_setting_callback_forum_mods() {
     619?>
     620
     621    <input name="_bbp_allow_forum_mods" id="_bbp_allow_forum_mods" type="checkbox" value="1" <?php checked( bbp_allow_forum_mods( true ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_forum_mods' ); ?> />
     622    <label for="_bbp_allow_forum_mods"><?php esc_html_e( 'Allow forums to have dedicated moderators', 'bbpress' ); ?></label>
    599623
    600624<?php
Note: See TracChangeset for help on using the changeset viewer.