[wp-trac] [WordPress Trac] #43877: Do not run unnecessary `user_has_cap` filter if the caps to check for include `do_not_allow` already

WordPress Trac noreply at wordpress.org
Wed Aug 29 16:08:25 UTC 2018


#43877: Do not run unnecessary `user_has_cap` filter if the caps to check for
include `do_not_allow` already
----------------------------------------+------------------------------
 Reporter:  flixos90                    |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Role/Capability             |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:
----------------------------------------+------------------------------

Comment (by dlh):

 It's a minor point, but I'm curious whether the `unset(
 $capabilities['do_not_allow'] );` could be kept even with the early return
 introduced in the patch. While the function it served in [40993] would no
 longer apply, the idea it represents is still accurate, it seems to me.

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


More information about the wp-trac mailing list