#46271 closed defect (bug) (invalid)
Class WP_User, methods add_cap/remove_cap are buggy
Reported by: | mr.psiho | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Users | Keywords: | |
Focuses: | Cc: |
Description
Both methods use/make check in $this->caps, while capabilities are actually located in $this->allcaps. Therefore both these methods simply do not work at the moment.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Ok, I got it! (spoiler: it was not obvious at all!) What I wanted to restrict user doing something. So, I just have to use it like this: $user->add_cap( 'read_post', false );