Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/16/2017 04:56:02 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Moderators: Introduce "Super Moderators" setting.

This change introduces the option (and default off value), admin setting and UI for toggling it on and off.

A "Super Moderator" is a moderator with the ability to also edit users, a commonly requested and popular feature in other forum software. The use-case is that user accounts may be spammers and need to be moderated beyond just their topics & replies, but the edit_users capability is reserved for Administrators (or Super Admins in multisite.) This setting will act as the global on/off to the deeper implementation of this feature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/settings.php

    r6544 r6563  
    208208                'title'             => esc_html__( 'Forum Moderators', 'bbpress' ),
    209209                'callback'          => 'bbp_admin_setting_callback_forum_mods',
     210                'sanitize_callback' => 'intval',
     211                'args'              => array()
     212            ),
     213
     214            // Allow moderators to edit users
     215            '_bbp_allow_super_mods' => array(
     216                'title'             => esc_html__( 'Super Moderators', 'bbpress' ),
     217                'callback'          => 'bbp_admin_setting_callback_super_mods',
    210218                'sanitize_callback' => 'intval',
    211219                'args'              => array()
     
    832840    <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' ); ?> />
    833841    <label for="_bbp_allow_forum_mods"><?php esc_html_e( 'Allow forums to have dedicated moderators', 'bbpress' ); ?></label>
     842
     843<?php
     844}
     845
     846/**
     847 * Allow super-mods setting field
     848 *
     849 * @since 2.6.0 bbPress (r6562)
     850 *
     851 * @uses checked() To display the checked attribute
     852 */
     853function bbp_admin_setting_callback_super_mods() {
     854?>
     855
     856    <input name="_bbp_allow_super_mods" id="_bbp_allow_super_mods" type="checkbox" value="1" <?php checked( bbp_allow_super_mods( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_super_mods' ); ?> />
     857    <label for="_bbp_allow_super_mods"><?php esc_html_e( 'Allow moderators to edit other users', 'bbpress' ); ?></label>
    834858
    835859<?php
Note: See TracChangeset for help on using the changeset viewer.