[wp-trac] [WordPress Trac] #51124: Can we get an additional parameter in wp_add_inline_script to set the script type?

WordPress Trac noreply at wordpress.org
Wed Aug 13 05:25:56 UTC 2025


#51124: Can we get an additional parameter in wp_add_inline_script to set the
script type?
------------------------------------------------+--------------------------
 Reporter:  hcabrera                            |       Owner:  audrasjb
     Type:  feature request                     |      Status:  accepted
 Priority:  normal                              |   Milestone:  Future
                                                |  Release
Component:  Script Loader                       |     Version:
 Severity:  normal                              |  Resolution:
 Keywords:  needs-patch needs-unit-tests early  |     Focuses:
------------------------------------------------+--------------------------

Comment (by galbaras):

 Looks like this could be done via the 'wp_inline_script_attributes' filter
 hook in
 [https://developer.wordpress.org/reference/functions/wp_get_inline_script_tag/
 wp_get_inline_script_tag()].

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


More information about the wp-trac mailing list