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.


Top ↑

Source

File: wp-includes/class.wp-scripts.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.