[wp-trac] [WordPress Trac] #51325: Add a filter for script/style tags injected by wp_add_inline_{script|style}

WordPress Trac noreply at wordpress.org
Sat May 8 14:44:41 UTC 2021


#51325: Add a filter for script/style tags injected by wp_add_inline_{script|style}
---------------------------+---------------------
 Reporter:  pjohanneson    |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  5.8
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+---------------------
Changes (by Clorith):

 * keywords:  has-patch needs-refresh =>


Comment:

 Thank you for refreshing the patch for 5.8.0.

 In looking over, your choice to add these filters in the `do_action`
 functions might not be enough, you may instead need to add it inside
 `WP_Scripts::print_inline_script` and `WP_Styles::print_inline_style`.

 A quick look shows that a few plugins and themes at least do call these
 functions directly, so anyone implementing the new filters would likely
 expect their adjustments to work in those cases as well.

 For reference: [https://wpdirectory.net/search/01F566NZKESD31YEX57QS1QJJC
 plugins calling `print_inline_script`],
 [https://wpdirectory.net/search/01F566P7TD4X1J94S55JV3D1SX plugins calling
 `print_inline_style`],
 [https://wpdirectory.net/search/01F566PN2CAB2H4781VYCNE12P themes calling
 `print_inline_script`],
 [https://wpdirectory.net/search/01F566PBYP66KPW8MGHC0EN12P themes calling
 `print_inline_style`].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51325#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list