Was thinking about this : dequeue or enqueue scripts with IE for example.
They say we can use global $is_IE;
but that’s wrong simply because it’s not compatible with caching. Nowadays cache is everywhere !
Does someone have an idea about this?
I mean if I want some styles in IE8 I can do this :
add_action( 'wp_head', '_load_ie_styles' );
function _load_ie_styles() {
global $wp_styles;
wp_register_style( 'ie8', get_stylesheet_directory_uri().'/css/style-ie8.css' );
$wp_styles->add_data( 'ie8', 'conditional', 'if IE 8' );
wp_enqueue_style( 'ie8' );
}
Ok that’s cool ! Maybe if I want something to avoid IE I can do this (not tested) :
add_action( 'wp_head', '_load_ie_styles' );
function _load_ie_styles() {
global $wp_styles;
wp_register_style( 'not-ie', get_stylesheet_directory_uri().'/css/style-not-ie.css' );
$wp_styles->add_data( 'not-ie', 'conditional', 'if !IE' );
wp_enqueue_style( 'not-ie' );
}
But how to do this with scripts? How can I dequeue scripts condionnally (IE) ?
Hope I’m clear.
Does someone have any thought about this?