[wp-trac] [WordPress Trac] #14994: Introduce a way to identify a hook in progress

WordPress Trac noreply at wordpress.org
Sat Feb 8 01:49:12 UTC 2014


#14994: Introduce a way to identify a hook in progress
------------------------------------------+------------------
 Reporter:  nacin                         |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  3.9
Component:  Plugins                       |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+------------------

Comment (by ericmann):

 Replying to [comment:18 nacin]:
 > Filters can be nested to create a "stack" — this is to check if the
 filter is anywhere in the stack. 14994.3.diff seems better.

 In hindsight, I see that you're right with this.  The attempt of
 14994.4.diff was to remove the dependency on a global array, but _does_
 functionally change things since using `current_filter()` will only return
 the current filter, rather than checking against all others in the stack.

 For this particular change, I think 14994.3.diff is sufficient.  In the
 future, perhaps a `current_filters()` or similar function (abstracting
 from the global) could be used as a replacement.

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


More information about the wp-trac mailing list