[wp-trac] [WordPress Trac] #39007: Impossible to access current priority with WP_Hook

WordPress Trac noreply at wordpress.org
Thu Dec 1 21:12:33 UTC 2016


#39007: Impossible to access current priority with WP_Hook
-------------------------------------------------+-------------------------
 Reporter:  Rarst                                |       Owner:  pento
     Type:  feature request                      |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.7
Component:  Plugins                              |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch reporter-feedback needs-   |     Focuses:
  unit-tests                                     |
-------------------------------------------------+-------------------------
Changes (by pento):

 * keywords:   => has-patch reporter-feedback needs-unit-tests
 * owner:   => pento
 * status:  new => assigned
 * component:  General => Plugins
 * milestone:  Awaiting Review => 4.7


Comment:

 While this has never really been supported behaviour (particularly with
 how broken nested hooks were), I don't think it's unreasonable to
 explicitly allow access to the currently running priority of the current
 filter.

 @Rarst: How do you feel about [attachment:39007.diff]? To take your
 example, you'd use it as: `$wp_filter[ current_filter()
 ]->current_priority()`.

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


More information about the wp-trac mailing list