wp_inline_script_attributes WordPress Filter Hook

The wp_inline_script_attributes hook allows you to add extra attributes to an enqueued script. This can be useful for specifying script dependencies or other settings.

apply_filters( 'wp_inline_script_attributes', array $attributes, string $javascript ) #

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.

$javascript

(string)Inline JavaScript code.


Top ↑

Source

File: wp-includes/script-loader.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.7.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.

Show More