[wp-trac] [WordPress Trac] #47678: Modernize/simplify current_user_can()

WordPress Trac noreply at wordpress.org
Fri Jul 12 01:53:00 UTC 2019


#47678: Modernize/simplify current_user_can()
-------------------------------------+-------------------------------------
 Reporter:  jrf                      |       Owner:  pento
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  5.3
Component:  Role/Capability          |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-unit-      |     Focuses:  performance, coding-
  tests commit                       |  standards
-------------------------------------+-------------------------------------

Comment (by jrf):

 @pento Thanks for all the commits so far! I'll try and add the next set of
 patches tomorrow (my timezone).

 Replying to [comment:14 pento]:
 > Note: [45625] is slightly different from
 [attachment:47678-add_post_type_support.patch]: we don't need to use
 `func_num_args()`, as `$args()` will be set to an empty array if no bonus
 arguments are passed.


 True enough, though using `if ( $args )` isn't actually showing what you
 are testing for, `if ( ! empty( $args ) )` would have been my preference
 in that case, even if just to prevent the next person scratching their
 head trying to figure out what's happening ;-)

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


More information about the wp-trac mailing list