Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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)

#1 @swissspidy
11 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #14280.

#2 @SergeyBiryukov
11 years ago

  • Component GeneralPlugins
Note: See TracTickets for help on using tickets.