[wp-trac] [WordPress Trac] #54572: Add a function for updating the existing role instead of removing, then adding one
WordPress Trac
noreply at wordpress.org
Mon Sep 19 20:47:37 UTC 2022
#54572: Add a function for updating the existing role instead of removing, then
adding one
--------------------------------------+----------------------------
Reporter: maksimkuzmin | Owner: davidbaumwald
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.1
Component: Role/Capability | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+----------------------------
Changes (by davidbaumwald):
* owner: (none) => davidbaumwald
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"54213" 54213]:
{{{
#!CommitTicketReference repository="" revision="54213"
Role/Capability: Add a new `update_role` function.
Until now, changing a user's role involved deleting a user's role then re-
adding. This change creates a new `update_role` function and associated
method in `WP_Roles` to consolidate this process.
This commit also introduces new unit tests around `update_role` and adds
additional "unhappy path" tests for roles and capabilities in general.
Props maksimkuzmin, peterwilsoncc, NomNom99, costdev, SergeyBiryukov.
Fixes #54572.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54572#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list