script_loader_tag WordPress Filter Hook
The script_loader_tag hook is a WordPress hook that allows you to modify the output of the script tag. This hook is useful for adding or removing attributes from the script tag, or for adding extra code to the script tag.
apply_filters( 'script_loader_tag', string $tag , string $handle , string $src ) #
Filters the HTML script tag of an enqueued script.
Parameters
- $tag
(string)The
<script>
tag for the enqueued script.- $handle
(string)The script's registered handle.
- $src
(string)The script's source URL.
Source
Changelog
Version | Description |
---|---|
4.1.0 | Introduced. |