wp_print_script_tag( array $attributes )
- Since
- 5.7.0
- Source
wp-includes/script-loader.php:2910
Prints formatted
<script> loader tag.Description
It is possible to inject attributes in the
<script> tag via the 'wp_script_attributes' filter.Automatically injects type attribute if needed.Parameters
$attributesarray- Key-value pairs representing
<script>tag attributes.
Uses · 1
- wp_get_script_tag()Formats `` loader tags.
Used by · 1
- WP_Script_Modules::print_enqueued_script_modules()Prints the enqueued script modules using script tags with type="module" attributes.
Source
function wp_print_script_tag( $attributes ) { echo wp_get_script_tag( $attributes );}History
Introduced in 5.7.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Parameter
$attributes retyped from array to untyped.verified against source5.7.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 tag, from
src/wp-includes/script-loader.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.