wp_print_inline_script_tag( string $javascript, array $attributes = array() )

In this article

Prints inline JavaScript wrapped in 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

$javascriptstringrequired
Inline JavaScript code.
$attributesarrayoptional
Key-value pairs representing <script> tag attributes.

Default:array()

Source

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

Changelog

VersionDescription
5.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.