• After updating to WordPress 6.9, the Twenty Seventeen theme triggers a deprecation notice related to IE-conditional styles and scripts.

    These conditional comments are no longer supported in WordPress 6.9, resulting in repeated warnings in the PHP logs and on screen (when WP_DEBUG is enabled).

    Deprecated: Function WP_Dependencies->add_data() was called with an argument
    that is deprecated since version 6.9.0! IE conditional comments are ignored
    by all supported browsers.
    in /wp-includes/functions.php on line 6131


    The issue originates from:

    wp-content/themes/twentyseventeen/functions.php

    Specifically the following block:

    // Register the Internet Explorer 9 specific stylesheet, to fix display issues in the Customizer.
    if ( is_customize_preview() ) {
    wp_register_style( 'twentyseventeen-ie9', get_theme_file_uri( '/assets/css/ie9.css' ), array( 'twentyseventeen-style' ), '20161202' );
    wp_style_add_data( 'twentyseventeen-ie9', 'conditional', 'IE 9' );
    }

    // Register the Internet Explorer 8 specific stylesheet.
    wp_register_style( 'twentyseventeen-ie8', get_theme_file_uri( '/assets/css/ie8.css' ), array( 'twentyseventeen-style' ), '20161202' );
    wp_style_add_data( 'twentyseventeen-ie8', 'conditional', 'lt IE 9' );

    // Register the html5 shiv.
    wp_register_script( 'html5', get_theme_file_uri( '/assets/js/html5.js' ), array(), '20161020' );
    wp_script_add_data( 'html5', 'conditional', 'lt IE 9' );

    The theme should remove or hard-deprecate all IE-specific stylesheet and script registrations.

    This includes:

    • ie8.css
    • ie9.css
    • html5.js
    • Removal of wp_style_add_data() / wp_script_add_data() with ‘conditional’ usage.
    • This topic was modified 5 months, 3 weeks ago by Andreas Panag.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.