[wp-trac] [WordPress Trac] #39059: Remove unnecessary `is_super_admin()` checks for editing others posts

WordPress Trac noreply at wordpress.org
Wed Dec 7 20:01:52 UTC 2016


#39059: Remove unnecessary `is_super_admin()` checks for editing others posts
-----------------------------+------------------------
 Reporter:  flixos90         |       Owner:  flixos90
     Type:  defect (bug)     |      Status:  assigned
 Priority:  normal           |   Milestone:  4.8
Component:  Role/Capability  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  multisite
-----------------------------+------------------------

Comment (by jeremyfelt):

 [attachment:39059.diff] looks good, @flixos90. Can we combine the first
 two `if` clauses now that `is_super_admin()` is removed?

 `if ( post_type_supports($post_type, 'author') && current_user_can( .... )
 )`

 That changes a bit more code, but leaves a cleaner read IMO.

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


More information about the wp-trac mailing list