Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#24570 closed feature request (duplicate)

Add conditional tag support for wp_enqueue_script functions

Reported by: otto42's profile Otto42 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


The style enqueueing functions support the use of conditionals for adding IE-style comment conditionals around stylesheet declarations, like so:

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' );

This same support should be migrated to the javascript enqueueing system, so as to allow specific javascripts to be loaded only in IE.

This would allow the declaration of html5.js to be properly enqueued instead of hardcoded into the header.php of twentyeleven, twentytwelve, and twentythirteen.

Change History (1)

#1 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #16024.

Note: See TracTickets for help on using tickets.