[wp-trac] [WordPress Trac] #33886: Need ability to determine the priority at which an action hook or filter is being run

WordPress Trac noreply at wordpress.org
Fri Sep 25 09:13:34 UTC 2015


#33886: Need ability to determine the priority at which an action hook or filter is
being run
-------------------------+------------------------------
 Reporter:  bobbingwide  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Plugins      |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by bobbingwide):

 Replying to [comment:2 SergeyBiryukov]:
 > `has_filter( current_filter(), __FUNCTION__ )` returns the priority.

 This returns the priority of the first invocation, not the current one.
 My routine can be attached to the same hook with multiple priorities.
 e.g. the_content:11,the_content:10

 So for priority 10, with verbose tracing I could see the results after
 these filters have been applied
 {{{
 wp-content/plugins/oik-bwtrace/includes/bwtrace-actions.php(333:64)
 bw_trace_inspect_current(1) 339 2015-09-25T09:10:13+00:00 1.695575
 0.024268 cf=genesis_loop,genesis_entry_content,the_content 27 17898
 31566984/32127896 F=293 current Array
 (
     [convert_smilies] => Array
         (
             [function] => convert_smilies
             [accepted_args] => 1
         )

     [convert_chars] => Array
         (
             [function] => convert_chars
             [accepted_args] => 1
         )

     [prepend_attachment] => Array
         (
             [function] => prepend_attachment
             [accepted_args] => 1
         )

     [bw_trace_results] => Array
         (
             [function] => bw_trace_results
             [accepted_args] => 9.10
         )

 )
 }}}

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


More information about the wp-trac mailing list