[wp-trac] [WordPress Trac] #6283: apply_filters() bug

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 18 18:02:08 GMT 2008


#6283: apply_filters() bug
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  anonymous
     Type:  defect             |      Status:  new      
 Priority:  normal             |   Milestone:  2.6      
Component:  General            |     Version:  2.5      
 Severity:  normal             |    Keywords:           
-------------------------------+--------------------------------------------
 the documented arguments are:

 add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)

 I would expect, upon announcing that zero arguments are involved in a
 function, that wp would simply call it and move on with life.

 I get this strange result, however:

 function foo() { /* do something, return nothing */ }

 add_filter('the_content', 'foo', 0, 0);

 var_dump(apply_filters('the_content', 'bar'));

 returned result: ''

 expected result: the_content filtered 'bar' as if foo had not been called

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


More information about the wp-trac mailing list