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

WordPress Trac noreply at wordpress.org
Thu May 27 15:51:22 UTC 2021


#35357: Introduce did_filter()
-------------------------------------------------+-------------------------
 Reporter:  mordauk                              |       Owner:  chriscct7
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:
Component:  Plugins                              |     Version:  2.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  refresh                                        |
-------------------------------------------------+-------------------------

Comment (by andykeith):

 I would be interested in adding this to core. I've created a patch which
 adds a `did_filter` function which operates in a similar way to
 `did_action`, but counts the number of times a filter has run. It creates
 a new global `$wp_filters` to store the counts (c.f. `$wp_actions` and
 `did_action`). If added it would round out the functions in this area to
 give the following:

 * add_action
 * do_action
 * doing_action
 * did_action
 * add_filter
 * apply_filters
 * doing_filter
 * did_filter [new]

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


More information about the wp-trac mailing list