wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_script_add_data › WordPress Function

Since4.2.0
已弃用n/a
wp_script_add_data ( $handle, $key, $value )
参数: (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
查看:
  • WP_Dependencies::add_data()
返回:
  • (bool) True on success, false on failure.
定义在:
文档:

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.


源码

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