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

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 20 09:25:13 GMT 2009


#6283: apply_filters() bug
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |        Owner:  westi  
     Type:  defect (bug)       |       Status:  closed 
 Priority:  normal             |    Milestone:  2.9    
Component:  General            |      Version:  2.5    
 Severity:  normal             |   Resolution:  invalid
 Keywords:  needs-patch        |  
-------------------------------+--------------------------------------------
Changes (by Denis-de-Bernardy):

  * keywords:  reporter-feedback => needs-patch
  * milestone:  => 2.9


Comment:

 no no, it's not invalid.

 I initially ran into this one while playing around with caching
 functionalities. Basically, I wanted some caches to get flushed on various
 hooks in WP that were called by apply_filters() rather than do_action().
 Since then, I've "fixed" this by sticking to having an $in = null variable
 on cache flushing functions, and returning that $in at the end of the
 function.

 Still, if the function is announced as having zero arguments, the
 apply_filters function should probably ignore whatever it returns (if
 anything). Or then the documentation needs to be clarified.

 It's an arguably minor defect, but it's definitely a confusion one when
 you initially run into it.

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


More information about the wp-trac mailing list