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/src/wp-includes/functions.wp-styles.php

    r58200 r60948  
    221221 *
    222222 * Possible values for $key and $value:
    223  * 'conditional' string      Comments for IE 6, lte IE 7 etc.
    224223 * 'rtl'         bool|string To declare an RTL stylesheet.
    225224 * 'suffix'      string      Optional suffix, used in combination with RTL.
     
    234233 * @since 5.8.0 Added 'path' as an official value for $key.
    235234 *              See {@see wp_maybe_inline_styles()}.
     235 * @since 6.9.0 'conditional' value changed. If the 'conditional' parameter is present
     236 *              the stylesheet will be ignored.
    236237 *
    237238 * @param string $handle Name of the stylesheet.
    238239 * @param string $key    Name of data point for which we're storing a value.
    239  *                       Accepts 'conditional', 'rtl' and 'suffix', 'alt', 'title' and 'path'.
     240 *                       Accepts 'rtl' and 'suffix', 'alt', 'title' and 'path'.
    240241 * @param mixed  $value  String containing the CSS data to be added.
    241242 * @return bool True on success, false on failure.
Note: See TracChangeset for help on using the changeset viewer.