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

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 22 07:42:45 UTC 2009


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

  * milestone:  2.9 => Future Release


Comment:

 I'm not sure we __need__ to do this.

 We shouldn't be encouraging create_function in this case anyway as there
 are possible security risk.

 Closures make it easier to write multi-line functions here which make the
 code even harder to read.

 Also looking at the php docs the fact that they are currently implemented
 by the Closure class should not be relied on - I'm not quite sure why they
 don't work exactly like create_function does that way it would all just
 work ;-)

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


More information about the wp-trac mailing list