Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/16/2017 04:56:02 PM (9 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/core/options.php

    r6544 r6563  
    4343        '_bbp_allow_topic_tags'       => 1,                          // Allow topic tagging
    4444        '_bbp_allow_forum_mods'       => 1,                          // Allow per-forum moderation
     45        '_bbp_allow_super_mods'       => 0,                          // Allow mods to edit users
    4546        '_bbp_allow_threaded_replies' => 0,                          // Allow threaded replies
    4647        '_bbp_allow_search'           => 1,                          // Allow forum-wide search
     
    409410 *
    410411 * @param bool $default Optional. Default value true.
    411  * @uses get_option() To get the allow per-forum moderators
     412 * @uses get_option() To get the allow per-forum moderators setting
    412413 *
    413414 * @return bool Are per-forum moderators allowed?
     
    417418    // Filter & return
    418419    return (bool) apply_filters( 'bbp_allow_forum_mods', (bool) get_option( '_bbp_allow_forum_mods', $default ) );
     420}
     421
     422/**
     423 * Are moderators allowed to edit users
     424 *
     425 * @since 2.6.0 bbPress (r6562)
     426 *
     427 * @param bool $default Optional. Default value true.
     428 * @uses get_option() To get the allow super moderators setting
     429 *
     430 * @return bool Are moderators allowed to edit users?
     431 */
     432function bbp_allow_super_mods( $default = 0 ) {
     433
     434    // Filter & return
     435    return (bool) apply_filters( 'bbp_allow_super_mods', (bool) get_option( '_bbp_allow_super_mods', $default ) );
    419436}
    420437
Note: See TracChangeset for help on using the changeset viewer.