wp_print_inline_script_tag

函数


wp_print_inline_script_tag ( $javascript, $attributes = array() )
参数
  • (string)
    $javascript
    Inline JavaScript code.
    Required:
  • (array)
    $attributes
    Optional. Key-value pairs representing `
定义位置
  • wp-includes/script-loader.php
    , line 2809
引入
5.7.0
弃用

Prints inline JavaScript wrapped in `

It is possible to inject attributes in the “ tag via the {@see ‘wp_script_attributes’} filter.
Automatically injects type attribute if needed.

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