wp_print_inline_script_tag()WP 5.7.0

Prints an inline script tag.

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

Хуков нет.

Возвращает

null. Ничего (null).

Использование

wp_print_inline_script_tag( $data, $attributes );
$data(строка) (обязательный)
Data for script tag: JavaScript, importmap, speculationrules, etc.
$attributes(массив)
Key-value pairs representing <script> tag attributes.
По умолчанию: array()

Список изменений

С версии 5.7.0 Введена.

Код wp_print_inline_script_tag() WP 6.5.2

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