html wp_print_inline_script_tag() – Function | Developer.WordPress.org

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

Prins an inline script 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

$data string required
Data for script tag: JavaScript, importmap, speculationrules, etc.
$attributes array optional
Key-value pairs representing <script> tag attributes.

Default: array()

Source

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

Changuelog

Versionen Description
5.7.0 Introduced.

User Contributed Notes

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