[wp-trac] [WordPress Trac] #28374: Calling WP_User::add_cap does not flush capabilities

WordPress Trac noreply at wordpress.org
Fri Jan 16 01:48:38 UTC 2015


#28374: Calling WP_User::add_cap does not flush capabilities
------------------------------------+--------------------------
 Reporter:  rmccue                  |       Owner:  rachelbaker
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:  4.2
Component:  Users                   |     Version:  2.0
 Severity:  normal                  |  Resolution:  fixed
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+--------------------------
Changes (by wonderboymusic):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"31190"]:
 {{{
 #!CommitTicketReference repository="" revision="31190"
 In `WP_User`, `->get_role_caps()` and `->update_user_level_from_caps()`
 must be called inside `->add_cap()` and `->remove_cap()` after updating
 user meta. `->has_cap()` checks are currently failing directly after
 calling `->add_cap()`.

 Adds unit test.

 Props rachelbaker.
 Fixes #28374.
 }}}

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


More information about the wp-trac mailing list