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

WordPress Trac noreply at wordpress.org
Wed Apr 3 21:19:09 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 schlessera):

 I forgot to mention two things:

 - Yes, the `RemovableClosure` is a `callable` to PHP, so it will just
 behave as a regular Closure, or any other callable.
 - We can still provide a convenience function, like `add_closure_action(
 $hook, $id, $closure, $priority, $num_args )` to hide the object
 instantiation. This can be then without BC break.

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


More information about the wp-trac mailing list