wp_print_inline_script_tag()WP 5.7.0

Prints inline JavaScript wrapped in <script> tag.

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

No Hooks.

Return

null. Nothing.

Usage

wp_print_inline_script_tag( $javascript, $attributes );
$javascript(string) (required)
Inline JavaScript code.
$attributes(array)
Key-value pairs representing <script> tag attributes.
Default: array()

Changelog

Since 5.7.0 Introduced.

Code of wp_print_inline_script_tag() WP 6.0

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