mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 19:24:34 +00:00
Add support for IE conditional comments for WP_Scripts to match the functionality of WP_Styles, including unit tests. Props filosofo, aaroncampbell, ethitter, georgestephanis, valendesigns. Fixes #16024.
git-svn-id: https://develop.svn.wordpress.org/trunk@31223 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -271,3 +271,25 @@ function wp_script_is( $handle, $list = 'enqueued' ) {
|
||||
|
||||
return (bool) wp_scripts()->query( $handle, $list );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @param string $handle Name of the script.
|
||||
* @param string $key Name of data point for which we're storing a value.
|
||||
* @param mixed $value String containing the data to be added.
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
function wp_script_add_data( $handle, $key, $value ){
|
||||
global $wp_scripts;
|
||||
return $wp_scripts->add_data( $handle, $key, $value );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user