[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
Tue Oct 11 20:08:30 UTC 2022


#54572: Add a function for updating the existing role instead of removing, then
adding one
-------------------------------------------------+-------------------------
 Reporter:  maksimkuzmin                         |       Owner:
                                                 |  davidbaumwald
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.1
Component:  Role/Capability                      |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:
  note                                           |
-------------------------------------------------+-------------------------

Comment (by manfcarlo):

 Replying to [comment:31 knutsp]:
 > I then suggest `update_role_name( $role )`.

 I did consider something like `update_role_name` or `rename_role`, but
 using `update_role` gives an opportunity to use the docblock to direct
 people to the other methods if they are looking for a way to update the
 capabilities of a role.

 Also, I don't know whether there's enough time to include the change in
 6.1, so in the event that `update_role` makes it in, the third parameter
 could just be deprecated rather than the whole function.

 Advice?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54572#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list