[wp-trac] [WordPress Trac] #35007: current_user_can('author') and current_user_can('contributor') returns true even if current user is administrator in multisite installation

WordPress Trac noreply at wordpress.org
Fri Dec 11 11:03:01 UTC 2015


#35007: current_user_can('author') and current_user_can('contributor') returns true
even if current user is administrator in multisite installation
-----------------------------+------------------------------
 Reporter:  edville101       |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Role/Capability  |     Version:  4.4
 Severity:  normal           |  Resolution:
 Keywords:  close            |     Focuses:  multisite
-----------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => close
 * focuses:   => multisite
 * component:  General => Role/Capability


Comment:

 Hi @edville101,

 You should not pass role names to `current_user_can()`, only capabilities.

 This was previously reported in #20824, see the discussion there.

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


More information about the wp-trac mailing list