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

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 21 19:49:09 UTC 2009


#10493: Allow closures as callbacks
-------------------------+--------------------------------------------------
 Reporter:  scribu       |       Owner:  scribu   
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.9      
Component:  General      |     Version:  2.9      
 Severity:  normal       |    Keywords:  has-patch
-------------------------+--------------------------------------------------

Comment(by scribu):

 Replying to [comment:1 Denis-de-Bernardy]:
 > As much as I *love* that syntax, I'm having a hard time imagining how to
 remove_filter() the mess if we need to.

 You could do this:


 {{{
 $func = function() {...};

 add_action('foobar', $func);
 remove_action('foobar', $func);
 }}}


 but that is sort of self-defeating.

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


More information about the wp-trac mailing list