[wp-trac] [WordPress Trac] #35357: Introduce did_filter()

WordPress Trac noreply at wordpress.org
Fri Jan 8 01:40:35 UTC 2016


#35357: Introduce did_filter()
--------------------------------------+------------------
 Reporter:  mordauk                   |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  4.5
Component:  Plugins                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------
Changes (by chriscct7):

 * keywords:   => has-patch has-unit-tests
 * version:  trunk =>
 * milestone:  Awaiting Review => 4.5


Comment:

 Implemented a method of counting filters as they run similar to to how
 actions are counted.

 If run after a filter is run, returns the number of functions that ran on
 the filter. If run in a function attached to a filter, returns the number
 of functions that have run on the filter before the current function. This
 works the same ways as did_action does, but for filters.

 Attached patch, and passing unit tests which test:
 1. Filter with no functions attached
 2. Filter with 1 function attached
 3. Filter with 2 functions attached

 Unit tests are passing. Let's get this in 4.5.

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


More information about the wp-trac mailing list