[wp-trac] [WordPress Trac] #16024: Conditional Comments for JS

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 19 23:29:56 UTC 2012


#16024: Conditional Comments for JS
-------------------------------------+-----------------------------
 Reporter:  filosofo                 |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Template                 |     Version:  3.4.1
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+-----------------------------
Changes (by ethitter):

 * keywords:  has-patch 3.3-early => has-patch needs-testing
 * version:  3.1 => 3.4.1


Comment:

 Replying to [comment:19 mattwiebe]:
 > This should also detect for the use-case of !IE (and other conditions
 which will show if 1) the condition is true or 2) the browser doesn't pay
 attention to CCs), which requires a slightly different syntax:

 16024.3.patch expands on what aaroncampbell worked on by adding the
 ability to target browsers other than IE.

 To do so, rather than passing a string for the conditional, an array is
 used. I took this approach rather than parsing the conditional's content
 to determine if non-IE browsers are targeted. The array syntax is only
 needed to flag that the syntax should be tweaked as mattwiebe noted, so a
 string can still be passed for all IE-specific conditionals.

 Array structure:
 `array( 'condition' => '!IE', 'target_ie' => false )`

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


More information about the wp-trac mailing list