wp_script_attributes WordPress Filter Hook
The wp_script_attributes hook allows you to modify the attributes of a script tag. This can be useful for adding custom data-* attributes, or for changing the src of a script tag.
apply_filters( 'wp_script_attributes', array $attributes ) #
Filters attributes to be added to a script tag.
Parameters
- $attributes
(array)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.
Source
Changelog
Version | Description |
---|---|
5.7.0 | Introduced. |