[wp-trac] [WordPress Trac] #10493: Allow closures as callbacks

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 8 00:48:55 UTC 2010


#10493: Allow closures as callbacks
------------------------------+---------------------------------------------
 Reporter:  scribu            |        Owner:  scribu
     Type:  enhancement       |       Status:  closed
 Priority:  normal            |    Milestone:  3.0   
Component:  Plugins           |      Version:  2.9   
 Severity:  normal            |   Resolution:  fixed 
 Keywords:  has-patch commit  |  
------------------------------+---------------------------------------------

Comment(by mikeschinkel):

 @scribu I don't care strongly about this, but do feel compelled to point
 out that your alternative is not at all equivalent to what I suggested.

 Making a regular function pollutes the public namespace for functions
 whereas my proposed solution only need be unique among hooks used in this
 manner; every function that WordPress required a developer to add greater
 potential for conflict.

 Your second suggestion also presumes that a.) the person adding the action
 had the forethought to save the closure and/or b.) the person needing to
 remove the action actually has access to the saved closure, both of which
 are unlikely except with the most forward thinking of plugin and theme
 developers.

 FWIW.

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


More information about the wp-trac mailing list