[wp-trac] [WordPress Trac] #46635: Improve identifying of non–trivial callbacks in hooks

WordPress Trac noreply at wordpress.org
Wed Apr 3 19:15:41 UTC 2019


#46635: Improve identifying of non–trivial callbacks in hooks
-------------------------+-------------------------------
 Reporter:  Rarst        |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  coding-standards
-------------------------+-------------------------------

Comment (by azaozz):

 The discussion about closures in hooks here and on
 https://make.wordpress.org/core/2019/03/26/coding-standards-updates-for-
 php-5-6/ has been ...fascinating :)

 As there doesn't seem to be a good way to remove filters and actions where
 the callback is a closure for now, I think we should add a "Doing it
 wrong" warnings so all new plugin/theme developers are aware they are
 breaking the hooks API.

 If/when closures become "easily removable", we can remove the Doing it
 wrong warnings too.

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


More information about the wp-trac mailing list