[wp-trac] [WordPress Trac] #21172: Adding the first filter/action in an earlier priority during a later priority causes the earlier priority to run (last)

WordPress Trac wp-trac at lists.automattic.com
Thu Jul 5 23:30:54 UTC 2012


#21172: Adding the first filter/action in an earlier priority during a later
priority causes the earlier priority to run (last)
--------------------------+-----------------------------
 Reporter:  devesine      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:  3.4
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 During testing of #21169, it occurred to me that
 [http://core.trac.wordpress.org/ticket/5338#comment:1] might present a
 problem with each rather than next/current, but that turns out not to be
 the case.  Instead, this exposed a different bug:

 If you add a new filter at priority 9, when priority 9 did not previously
 have any filters, during the priority 10 execution, the priority 9 filter
 will run (!) after all other priorities (since the filters are not
 resorted after each priority).

 (Generally, if you add an earlier priority that did not previously have
 any filters during a later priority...)

 The attached unit test demonstrates this behavior.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21172>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list