wp_script_add_data

SummerySummery

Add metadata to a script.

Syntax

wp_script_add_data( string $handle, string $key, mixed $value )

DescriptionDescription

Works only if the script has already been added.

Possible values for $key and $value: ‘conditional’ string Comments for IE 6, lte IE 7, etc.

ParametersParameters

$handle

(string) (Required) Name of the script.

$key

(string) (Required) Name of data point for which we're storing a value.

$value

(mixed) (Required) String containing the data to be added.

ReturnReturn

(bool) True on success, false on failure.

SourceSource

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


			

ChangelogChangelog

Changelog
Version Description
4.2.0 Introduced.

See alsoSee also

Scroll to Top