WordPress at a glance

wp_script_add_data() WP 1.0

Add metadata to a script.

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.

  • See: WP_Dependency::add_data()

No Hooks.

Return

true/false. True on success, false on failure.

Usage

wp_script_add_data( $handle, $key, $value );
$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.

Code of wp_script_add_data: wp-includes/functions.wp-scripts.php VER 5.0

<?php
function wp_script_add_data( $handle, $key, $value ){
	return wp_scripts()->add_data( $handle, $key, $value );
}

Related Functions

From tag: script

More from category: Scripts and Styles

No comments
    Hello, !     Log In . Register