Making WordPress.org

Changeset 12144


Ignore:
Timestamp:
10/21/2022 05:57:42 AM (3 years ago)
Author:
dd32
Message:

Rosetta: Store Locale Manager role capabilities on the role itself, rather than synamically adding them.

This allows for WP_User_Query to find the role, which allows for users with the role to show in the Post Authors dropdown.

See #6326

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/user/role/class-locale-manager.php

    r6884 r12144  
    3030    public static function get_capabilities() {
    3131        return [
    32             'level_1' => true, // Make user visible in authors dropdown, see https://core.trac.wordpress.org/ticket/16841.
    33         ];
    34     }
    35 
    36     /**
    37      * Retrieves the dynamic capabilities for this role.
    38      *
    39      * @return array Array of dynamic capabilities.
    40      */
    41     public static function get_dynamic_capabilities() {
    42         return [
    43             // Core.
     32            'level_1'                    => true,
    4433            'read'                       => true,
    4534            'moderate_comments'          => true,
     
    7160            'promote_users'              => true,
    7261            'remove_users'               => true,
     62        ];
     63    }
    7364
     65    /**
     66     * Retrieves the dynamic capabilities for this role.
     67     *
     68     * @return array Array of dynamic capabilities.
     69     */
     70    public static function get_dynamic_capabilities() {
     71        return [
    7472            // Custom.
    7573            'manage_translation_editors' => true,
Note: See TracChangeset for help on using the changeset viewer.