Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#42564 new defect (bug)

Use `promote_users` for role updates in edit_user()

Reported by: ocean90 Owned by:
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords: has-patch
Focuses: Cc:


edit_user() can also update user roles but is still using the edit_users capability instead of the newer promote_users capability introduced in [14176].

We have a similar role handling in https://core.trac.wordpress.org/browser/tags/4.8.3/src/wp-admin/users.php?marks=96-97,121-128#L93 and should copy that to edit_user() for consistency.

  • Change edit_users to promote_users
  • Change manage_site to manage_network_users

Attachments (1)

42564.diff (1.9 KB) - added by ocean90 4 months ago.
Also props to @jjj and @flixos90

Download all attachments as: .zip

Change History (2)

4 months ago

Also props to @jjj and @flixos90

#1 @johnbillion
4 months ago

  • Milestone changed from 4.9.1 to 5.0
Note: See TracTickets for help on using tickets.