WP_Scripts::get_inline_script_tag() – Method | Developer.WordPress.org

Gets tags for inline scripts registered for a specific handle.

Parameters

$handlestringrequired

Name of the script to get associated inline script tag for.
Must be lowercase.

$positionstringoptional

Whether to get tag for inline scripts in the before or after position. Default 'after'.

Return

string Inline script, which may be empty string.

Source

public function get_inline_script_tag( $handle, $position = 'after' ) {
	$js = $this->get_inline_script_data( $handle, $position );
	if ( empty( $js ) ) {
		return '';
	}

	$id = "{$handle}-js-{$position}";

	return wp_get_inline_script_tag( $js, compact( 'id' ) );
}

View all references View on Trac View on GitHub

Changelog

VersionDescription
6.3.0Introduced.