WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#33957 closed enhancement (invalid)

wp_enqueue_style conditional

Reported by: sebastian.pisula Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3.1
Component: General Keywords:
Focuses: Cc:

Description

Example:

wp_enqueue_style('ie-hacks', get_template_directory_uri() . '/css/ie.min.css', false, '1.2.2', 'all', array('conditional' => 'lt IE 9'));

Attachments (1)

33957.patch (3.5 KB) - added by sebastian.pisula 6 years ago.

Download all attachments as: .zip

Change History (2)

#1 @swissspidy
6 years ago

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

You can already add conditional comments for IE with wp_enqueue_style. Example:

global $wp_styles;
wp_enqueue_style( 'my-theme-ie7', get_stylesheet_directory_uri() . "/css/ie7.css"  );
$wp_styles->add_data( 'my-theme-ie7', 'conditional', 'IE 7' );

I don't think adding an extra param for this makes sense. Older IE versions are slowly dying and newer versions don't even support conditional comments anymore.

Note: See TracTickets for help on using tickets.