Make WordPress Core


Ignore:
Timestamp:
05/26/2023 05:23:49 PM (3 years ago)
Author:
westonruter
Message:

Bundled Themes: Remove/disable obsolete IE-specific skip-link-focus-fix.

  • Removes script from the wp_print_footer_scripts action in Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One.
  • Switches enqueue functions to just register the scripts in Twenty Fifteen, Twenty Sixteen, and Twenty Seventeen.
  • Rearranges Twenty Seventeen's scripts to connect twentyseventeenScreenReaderText with the global script instead of the unused skip link fix.
  • Updates scripts in Twenty Fifteen and Twenty Sixteen with code from Twenty Seventeen _to run on Internet Explorer only_. Twenty Sixteen needed to keep an adjustment that offsets the toolbar and border.
  • Removes the script from JS files in Twenty Thirteen and Twenty Fourteen and edits their modified dates.

Props sabernhardt, westonruter, joedolson, flixos90, mukesh27.
Fixes #54421.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/functions.php

    r55476 r55861  
    484484    wp_script_add_data( 'html5', 'conditional', 'lt IE 9' );
    485485
    486     wp_enqueue_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', true );
     486    // Skip-link fix is no longer enqueued by default.
     487    wp_register_script( 'twentyseventeen-skip-link-focus-fix', get_theme_file_uri( '/assets/js/skip-link-focus-fix.js' ), array(), '20161114', true );
     488
     489    wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20211130', true );
    487490
    488491    $twentyseventeen_l10n = array(
     
    502505    }
    503506
    504     wp_enqueue_script( 'twentyseventeen-global', get_theme_file_uri( '/assets/js/global.js' ), array( 'jquery' ), '20211130', true );
     507    wp_localize_script( 'twentyseventeen-global', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n );
    505508
    506509    wp_enqueue_script( 'jquery-scrollto', get_theme_file_uri( '/assets/js/jquery.scrollTo.js' ), array( 'jquery' ), '2.1.3', true );
    507 
    508     wp_localize_script( 'twentyseventeen-skip-link-focus-fix', 'twentyseventeenScreenReaderText', $twentyseventeen_l10n );
    509510
    510511    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
Note: See TracChangeset for help on using the changeset viewer.