[wp-trac] [WordPress Trac] #46271: Class WP_User, methods add_cap/remove_cap are buggy

WordPress Trac noreply at wordpress.org
Mon Feb 18 13:25:20 UTC 2019


#46271: Class WP_User, methods add_cap/remove_cap are buggy
--------------------------+------------------------------
 Reporter:  mr.psiho      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Users         |     Version:  5.0.3
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by mr.psiho):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Ok, I got it! (spoiler: it was not obvious at all!) I just have to use it
 like this: $user->add_cap( 'read_post', false );

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


More information about the wp-trac mailing list