[wp-trac] [WordPress Trac] #48824: Array to pass in add_action or add_filter

WordPress Trac noreply at wordpress.org
Thu Nov 28 11:16:54 UTC 2019


#48824: Array to pass in add_action or add_filter
--------------------------+-----------------------------
 Reporter:  tazotodua     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 there are times when we do:

 {{{#!php
 add_action('wp_head', 'smth');
 add_action('admin_head', 'smth');

 function smh(){
   //...
 }
 }}}

 It would be convenient to have an ability to pass the array:
 {{{#!php
 add_action(['wp_head','admin_head'],  'smth');

 ...
 }}}


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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48824>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list