[theme-reviewers] User Agent Sniffing
otto at ottodestruct.com
Tue Mar 25 00:19:42 UTC 2014
For the specific case of stylesheets, there is a way to have it add the IE
if statements directly. Examine this code from Twenty Twelve:
wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() .
'/css/ie.css', array( 'twentytwelve-style' ), '20121010' );
$wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' );
There's no support for scripts like this yet (I think), but for older IE
versions, this is the simplest way.
On Mon, Mar 24, 2014 at 12:55 PM, Devin Price <devin at wptheming.com> wrote:
> I don't see any guidelines against user agent sniffing, but it seems like
> a bad practice to me especially when there are better methods for checking
> for IE versions. Also, with the popularity of caching plugins it seems
> like enqueing scripts based on a user agent could cause issues. Has there
> been a discussion of this in the past? The theme I'm currently reviewing
> is here: https://themes.trac.wordpress.org/ticket/17401
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the theme-reviewers