[wp-trac] [WordPress Trac] #5231: add_action('all', ...) causes unexpected behaviour

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 18 23:27:33 GMT 2007


#5231: add_action('all', ...) causes unexpected behaviour
------------------------+---------------------------------------------------
 Reporter:  tellyworth  |       Owner:  anonymous
     Type:  defect      |      Status:  new      
 Priority:  normal      |   Milestone:  2.5      
Component:  General     |     Version:           
 Severity:  normal      |    Keywords:           
------------------------+---------------------------------------------------
 This might be intentional, but it doesn't seem to be documented.  It's
 possible to use the 'all' tag when adding an action, not just a filter:

 {{{
 add_action('all', 'myaction');
 }}}

 However, the function will be called for all filters as well as all
 actions.  Unless the function behaves like a filter and returns its
 argument, all kinds of things will go wrong as it merrily NULLs the result
 of every filter.

 Possible solutions might be to run 'all' separately for filters and
 actions; prohibit 'all' actions; or keep the behaviour as-is and document
 it.

 FWIW, an 'all' action can be useful for debugging.

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


More information about the wp-trac mailing list