Adds metadata to a script.
Description
Works only if the script has already been registered.
Possible values for $key and $value: ‘conditional’ string Comments for IE 6, lte IE 7, etc.
See also
Parameters
$handlestringrequired- Name of the script.
$keystringrequired- Name of data point for which we’re storing a value.
$valuemixedrequired- String containing the data to be added.
Source
function wp_script_add_data( $handle, $key, $value ) {
return wp_scripts()->add_data( $handle, $key, $value );
}
Changelog
| Version | Description |
|---|---|
| 4.2.0 | Introduced. |
Enqueue IE-specific Scripts with conditional comments
Add IE-specific CDN Scripts with conditional comments