wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_print_inline_script_tag › WordPress Function

Since5.7.0
Deprecatedn/a
wp_print_inline_script_tag ( $data, $attributes = array() )
Parameters: (2)
  • (string) $data Data for script tag: JavaScript, importmap, speculationrules, etc.
    Required: Yes
  • (array) $attributes Optional. Key-value pairs representing `<script>` tag attributes.
    Required: No
    Default: array()
Defined at:
Codex:

Prints an inline script tag.

It is possible to inject attributes in the <script> tag via the {@see 'wp_script_attributes'} filter. Automatically injects type attribute if needed.


Source

function wp_print_inline_script_tag( $data, $attributes = array() ) {
	echo wp_get_inline_script_tag( $data, $attributes );
}