[wp-trac] [WordPress Trac] #9968: dynamically adding/removing filters breaks plugins

WordPress Trac wp-trac at lists.automattic.com
Thu May 28 23:43:12 GMT 2009


#9968: dynamically adding/removing filters breaks plugins
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:                         
     Type:  defect (bug)       |      Status:  new                    
 Priority:  high               |   Milestone:  2.8                    
Component:  Plugins            |     Version:                         
 Severity:  blocker            |    Keywords:  has-patch tested commit
-------------------------------+--------------------------------------------
 noticed this while doing something similar to this:

 {{{
 add_action('foo', 'bar1', 10);
 add_action('foo', 'bar2', 20);

 function bar1() {
   remove_filter('foo', 'bar1', 10);
 }
 }}}

 in the above, bar2() doesn't get called. it is because of the usage of
 next()/current() to loop through filters.

 attached patch uses a foreach loop instead, to make it work.

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


More information about the wp-trac mailing list