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

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 7 23:32:56 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):

 Suggestion to consider to address the concern for removing?

 Instead of
 {{{
 add_action('init', function() { // do something });
 }}}
 How about?:
 {{{
 add_action('init', array('name',function() { // do something }));
 }}}

 The latter allows a name to be associated with the function but not one
 that will conflict with a function name. It could be optional for those
 who want to all their use of the hook to be removed.

 Just an idea...

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


More information about the wp-trac mailing list