wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_script_add_data › WordPress Function

Since4.2.0
Deprecatedn/a
wp_script_add_data ( $handle, $key, $value )
Parameters: (3)
  • (string) $handle Name of the script.
    Required: Yes
  • (string) $key Name of data point for which we're storing a value.
    Required: Yes
  • (mixed) $value String containing the data to be added.
    Required: Yes
See:
  • WP_Dependencies::add_data()
Returns:
  • (bool) True on success, false on failure.
Defined at:
Codex:

Adds metadata to a script.

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.


Source

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