[wp-trac] [WordPress Trac] #35556: add_action accept array as first argument
WordPress Trac
noreply at wordpress.org
Thu Jan 21 11:28:53 UTC 2016
#35556: add_action accept array as first argument
-------------------------+-----------------------------
Reporter: madeinua | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
Would be a great possibility to allow accept first argument of the
function add_action as array:
Instead of this:
{{{#!php
add_action('action_1', 'myfunc');
add_action('action_2', 'myfunc');
add_action('action_3', 'myfunc');
}}}
have this:
{{{#!php
add_action(['action_1', 'action_2', 'action_3'], 'myfunc');
}}}
Of course foreach() also can be solution for this case but this option is
more elegance.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35556>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list