[wp-trac] [WordPress Trac] #26704: Multiple actions when using add_action

WordPress Trac noreply at wordpress.org
Sun Dec 22 10:03:43 UTC 2013


#26704: Multiple actions when using add_action
-----------------------------+-----------------------------
 Reporter:  sigurdbergsvela  |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:  trunk
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 I would like the possibility of naming several actions when using
 add_action
 I propose a space separated list. This will then be similar to jQuery’s
 on/bind/live.
    add_action(‘action_one action_two action_three’, ‘function_name’);

 Its true that, since you can just give it a function name, it is not that
 big a deal to just call
 add_action several times, but since php >= 5.3, php added anonomous
 function. Using anonomous function is create, if you don’t actually want
 to create a function for the code you want to be executed on an action.
 I, personally, before PHP 5.3 used insanely long function names in these
 situstions to avoid conflicts, but thats just ugly.

 Thats why i propose this

     add_action(‘one two three four’, function(){});

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26704>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list