[wp-trac] [WordPress Trac] #16118: Support for wp_enqueue_style with negative conditional comments

WordPress Trac wp-trac at lists.automattic.com
Tue May 1 11:48:28 UTC 2012


#16118: Support for wp_enqueue_style with negative conditional comments
-------------------------------------------------+-------------------------
 Reporter:  sayontan                             |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  General                              |  Release
 Severity:  normal                               |     Version:  3.4
 Keywords:  has-patch needs-testing dev-         |  Resolution:
  feedback                                       |
-------------------------------------------------+-------------------------
Changes (by sanchothefat):

 * keywords:  has-patch needs-testing => has-patch needs-testing dev-
               feedback
 * version:  3.0.4 => 3.4


Comment:

 There's one extra tweak you need for this to work properly that's in my
 attached patch (sorry - didn't name the first one correctly) As soon as
 there is an instance of '!IE' anywhere in the conditional we need to leave
 the contents of the CC uncommented.

 Take for example a more complex CC:

 {{{
 <!--[if (!IE)|(gte IE 9)]><!--> <link ... /> <!--<![endif]-->
 }}}

 The not IE logic can appear anywhere within the CC. Complex CCs will
 become more useful with the ability to target IEMobile too.

 I'd love to see this in core, not just for the sake of completeness but it
 makes writing stylesheets for plugins that need to separate support for
 older IEs and the newest much much better.

 I've tested my modification of Gary's patch with the above example and
 various others and it works fine.

 To test it work through the examples listed on this page:
 http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx

 '''Note:'''
 In cases like {{{!(IE 7)}}} the contents of the CC should still be
 commented. Only {{{!IE}}} should cause the contents to be uncommented.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16118#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list