#35556 closed enhancement (duplicate)
add_action accept array as first argument
| Reported by: | madeinua | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Plugins | Version: | 4.6 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #14280.