wp_print_inline_script_tag()
Prints an inline script tag.
It is possible to inject attributes in the <script> tag via the wp_inline_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(array<string, string|bool>)
- Key-value pairs representing
<script>tag attributes.
По умолчанию:array()
Список изменений
| С версии 5.7.0 | Введена. |
Код wp_print_inline_script_tag() wp print inline script tag WP 7.1.2
function wp_print_inline_script_tag( $data, $attributes = array() ) {
echo wp_get_inline_script_tag( $data, $attributes );
}