wp_print_inline_script_tag()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_print_inline_script_tag( string $data, $attributes = array() )
Описание
Можно внедрить атрибуты в тег с помощью фильтра 'wp_inline_script_attributes'.
При необходимости автоматически добавляет атрибут type.
Оригинал (английский)
It is possible to inject attributes in the <script> tag via the ‘wp_inline_script_attributes’ filter.
Automatically injects type attribute if needed.
Параметры
$data
string
обязательный
Исходный код
wp-includes/script-loader.php:3073
function wp_print_inline_script_tag( $data, $attributes = array() ) {
echo wp_get_inline_script_tag( $data, $attributes );
}
История изменений
| Версия | Описание |
|---|---|
| 5.7.0 | Introduced. |

