Skip to:
Content

bbPress.org

Changeset 4337


Ignore:
Timestamp:
11/04/2012 09:39:54 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Capabilities:

  • Use bbp_get_default_role() in bbp_get_user_role_map().
  • See #1939.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/users/capabilities.php

    r4336 r4337  
    137137 */
    138138function bbp_get_user_role_map() {
     139
     140    // Get the default role once here
     141    $default_role = bbp_get_default_role();
     142
     143    // Return filtered results, forcing admins to keymasters.
    139144    return (array) apply_filters( 'bbp_get_user_role_map', array (
    140145        'administrator' => bbp_get_keymaster_role(),
    141         'editor'        => bbp_get_participant_role(),
    142         'author'        => bbp_get_participant_role(),
    143         'contributor'   => bbp_get_participant_role(),
    144         'subscriber'    => bbp_get_participant_role(),
    145         ''              => bbp_get_participant_role()
     146        'editor'        => $default_role,
     147        'author'        => $default_role,
     148        'contributor'   => $default_role,
     149        'subscriber'    => $default_role,
     150        ''              => $default_role
    146151    ) );
    147152}
Note: See TracChangeset for help on using the changeset viewer.