[wp-trac] [WordPress Trac] #54860: Enhancement for more accurate doing_action, doing_filter

WordPress Trac noreply at wordpress.org
Thu Jan 20 02:12:53 UTC 2022


#54860: Enhancement for more accurate doing_action, doing_filter
-------------------------------+------------------------------
 Reporter:  Starbuck           |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:
 Severity:  minor              |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------
Changes (by Starbuck):

 * version:  4.7 =>


Comment:

 The functions `current_action` and `current_filter` would need similar
 refinement. There might be others.

 I also see that $wp_current_filter has actions that are not in $wp_filter
 when hooking for 'all' actions or filters. Without a WP_Hook object for
 those hook names there is no `$this->doing_action` value to check.  Both
 `do_action` and `apply_filters` call _wp_call_all_hook and I don't see
 anything to disambiguate between actions and filters in those methods. So
 this ticket doesn't address the 'all' hook either.

 To my knowledge so far, the proposal here doesn't break anything while it
 does improve one little area. I wasn't looking for comprehensive reform in
 the area of action/filter hook disambiguation, just to address one little
 challenge. :) Other enhancements to related functionality can be proposed
 in other tickets.

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


More information about the wp-trac mailing list