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

WordPress Trac noreply at wordpress.org
Wed Apr 3 16:39:51 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 giuseppe.mazzapica):

 For closures, what could be done is:

 * store `"function()"` in the hook class
 * if exactly `"function()"` is passed to `remove_filter` all closures
 added to that hook are removed
 * if something like `"function()@wp-content/plugins/foo/bar.php"` is
 passed, first all the callbacks with closures are retrieved (all those
 having `"function()"` as identifier) then they are looped to find a match
 in the declaring file.

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


More information about the wp-trac mailing list