Make WordPress Core


Ignore:
Timestamp:
10/24/2022 02:54:08 PM (23 months ago)
Author:
davidbaumwald
Message:

Role/Capability: Revert the newly added update_role function for 6.1.

Based on feedback, this enhancement isn't quite ready. Reverting [54213] for now to continue the work in the next cycle.

Follow-up to [54213].

Props manfcarlo, peterwilsoncc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/capabilities.php

    r54332 r54673  
    10321032
    10331033/**
    1034  * Updates an existing role. Creates a new role if it doesn't exist.
    1035  *
    1036  * Modifies the display name and/or capabilities for an existing role.
    1037  * If the role does not exist then a new role is created.
    1038  *
    1039  * The capabilities are defined in the following format: `array( 'read' => true )`.
    1040  * To explicitly deny the role a capability, set the value for that capability to false.
    1041  *
    1042  * @since 6.1.0
    1043  *
    1044  * @param string      $role         Role name.
    1045  * @param string|null $display_name Optional. Role display name. If null, the display name
    1046  *                                  is not modified. Default null.
    1047  * @param bool[]|null $capabilities Optional. List of capabilities keyed by the capability name,
    1048  *                                  e.g. `array( 'edit_posts' => true, 'delete_posts' => false )`.
    1049  *                                  If null, don't alter capabilities for the existing role and make
    1050  *                                  empty capabilities for the new one. Default null.
    1051  * @return WP_Role|void WP_Role object, if the role is updated.
    1052  */
    1053 function update_role( $role, $display_name = null, $capabilities = null ) {
    1054     return wp_roles()->update_role( $role, $display_name, $capabilities );
    1055 }
    1056 
    1057 /**
    10581034 * Removes a role, if it exists.
    10591035 *
Note: See TracChangeset for help on using the changeset viewer.