Summery Summery

Add metadata to a script.

Syntax Syntax

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

Description Description

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.

Parameters Parameters


(string) (Required) Name of the script.


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


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

Return Return

(bool) True on success, false on failure.

Source Source

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

	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );

	return (bool) wp_scripts()->query( $handle, $list );


Changelog Changelog

Version Description
4.2.0 Introduced.

See also See also


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.