[wp-trac] Re: [WordPress Trac] #4625: apply_filters is broken

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 8 12:44:48 GMT 2007

#4625: apply_filters is broken
 Reporter:  Denis-de-Bernardy  |        Owner:  anonymous  
     Type:  defect             |       Status:  new        
 Priority:  high               |    Milestone:  2.3 (trunk)
Component:  General            |      Version:  2.2.1      
 Severity:  normal             |   Resolution:             
 Keywords:  has-patch          |  
Comment (by darkdragon):

 Well, it could be faster having it as a while loop, but really, if all you
 need is to continue and iterate over all items, foreach might also work.

 It is all the same. I think the do ... while was for making sure that the
 first item was iterated over. It is also perhaps safer to remove items
 while inside the array (perhaps, but would need testing for foreach).

 while( ( $filter = next( $wp_filter[$tag] ) !== false)
     foreach( ... )


 '''A good reason''': Because it works and won't require more testing.

Ticket URL: <http://trac.wordpress.org/ticket/4625#comment:7>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list