Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#48824 closed defect (bug) (duplicate)

Array to pass in add_action or add_filter

Reported by: tazotodua's profile tazotodua Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: Cc:

Description

there are times when we do:

add_action('wp_head', 'smth');
add_action('admin_head', 'smth');

function smh(){
  //...
}

It would be convenient to have an ability to pass the array:

add_action(['wp_head','admin_head'],  'smth');

...

Will this be considered? if so, i'll try to upload the patch.

Change History (1)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Plugins
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks for the ticket, we're already tracking this enhancement in #14280.

Per the reasons stated in that ticket and in comment:2:ticket:26704, there are currently no plans to implement this due to performance impact it would have without any gained benefit for almost every existing use of the functions.

Note: See TracTickets for help on using tickets.