#35556 closed enhancement (duplicate)
add_action accept array as first argument
Reported by: | madeinua | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.6 |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description
Would be a great possibility to allow accept first argument of the function add_action as array:
Instead of this:
add_action('action_1', 'myfunc');
add_action('action_2', 'myfunc');
add_action('action_3', 'myfunc');
have this:
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.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Duplicate of #14280.