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

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 5 04:12:10 GMT 2007


#5231: add_action('all', ...) causes unexpected behaviour
-------------------------------------+--------------------------------------
 Reporter:  tellyworth               |        Owner:  anonymous
     Type:  defect                   |       Status:  new      
 Priority:  normal                   |    Milestone:  2.4      
Component:  General                  |      Version:           
 Severity:  normal                   |   Resolution:           
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Comment (by darkdragon):

 Well, to clarify, I did think about separation, but I do rather like
 having one function do all of the work. In the class, basically, I had one
 method that would take the $tag, $function_to_add, $priority, and
 $accepted_args and build the array, and then return it.

 Damn it! I just realized that the code I wrote wouldn't work! Damn you
 coordinate system! You '''have''' to duplicate the addition code! I was
 thinking an assignment from an function would work, but it wouldn't. If
 you did that you would overwrite everything that was in the array and
 would only store the new tag system.

 You also can't easily assign it to a variable and then use it in the array
 (tried that, pretty worthless).

 An extra three lines in add_action won't hurt anything. It would
 completely decouple filters from actions, which would require that the
 Plugin API documentation at the codex be updated.

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


More information about the wp-trac mailing list