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

WordPress Trac noreply at wordpress.org
Mon Jul 15 07:01:20 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 pento):

 Replying to [comment:23 jrf]:
 > There are two choices here:
 > 1. Revert that particular change.
 > 2. Update the method signature for the `walk()` and `paged_walk()`
 methods in child classes.
 >
 > I'm very much in favour of 2. Yes, WP is notorious for its backward-
 compatibility, but it's not as if other methods have never received new
 arguments if a functional change warranted this or am I mistaken ?

 New arguments are added to methods extremely rarely, and offset against
 the effort required for plugins to release a compatibility fix. The last
 instance I recall was `WP_Customize_Manager::__construct()` gaining a
 parameter in WP 4.7.

 There are [https://github.com/search?q=org%3Awp-
 plugins+%22extends+walker%22&type=Code ~260 instances] of `extend Walker`
 here, but presumably more in themes, custom plugins, etc.

 I think this change could still work, in combination with a dev-note, and
 an easy pattern for plugin authors to maintain back compat with old
 versions of WordPress.

 For now, I'm going to revert [45624] until we have a plan laid out.

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


More information about the wp-trac mailing list