Make WordPress Core


Ignore:
Timestamp:
10/16/2025 07:59:11 PM (4 months ago)
Author:
joedolson
Message:

General: Remove support for IE conditional comments.

Remove the ability to enqueue scripts and styles wrapped in IE conditional comment tags. Conditional comment support was removed from IE in version 10 in 2012, and no core supported browser renders them in any way. IE9 has global usage approaching zero. WordPress dropped support for IE10 and below in version 4.8.

Patch adds a deprecation notice if the conditional data argument is added. Scripts and styles are not printed, and neither are their dependencies if they are not required by other non-conditional scripts. Conditional dependencies are removed from core enqueues.

Props jonsurrell, joedolson, shailu25, siliconforks, dmsnell, sabernhardt, rollybueno.
Fixes #63821.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/styles.php

    r60920 r60948  
    328328     * Test to make sure that inline styles attached to conditional
    329329     * stylesheets are also conditional.
     330     *
     331     * @expectedDeprecated WP_Dependencies->add_data()
    330332     */
    331333    public function test_conditional_inline_styles_are_also_conditional() {
    332         $expected = <<<CSS
    333 <!--[if IE]>
    334 <link rel='stylesheet' id='handle-css' href='http://example.com?ver=1' type='text/css' media='all' />
    335 <style id='handle-inline-css' type='text/css'>
    336 a { color: blue; }
    337 /*# sourceURL=handle-inline-css */
    338 </style>
    339 <![endif]-->
    340 
    341 CSS;
     334        $expected = '';
    342335        wp_enqueue_style( 'handle', 'http://example.com', array(), 1 );
    343336        wp_style_add_data( 'handle', 'conditional', 'IE' );
Note: See TracChangeset for help on using the changeset viewer.