W3cubDocs

/WordPress

apply_filters( ‘wp_inline_script_attributes’, array $attributes, string $data )

Filters attributes to be added to a script tag.

Parameters

$attributesarray
Key-value pairs representing <script> tag attributes.
Only the attribute name is added to the <script> tag for entries with a boolean value, and that are true.
$datastring
Inline data.

Source

$attributes = apply_filters( 'wp_inline_script_attributes', $attributes, $data );

Changelog

Version Description
5.7.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_inline_script_attributes