Make WordPress Core

Changeset 46169


Ignore:
Timestamp:
09/18/2019 10:29:53 PM (5 years ago)
Author:
whyisjake
Message:

Accesibility: Replace wp-a11y.js with @wordpress/a11y package

Continuation of [46167]. This fixes the tests that ended up broken following the previous commit.

We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also
used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure
webpack to load is an external.

Props, garrett-eclipse

Fixes #45066

File:
1 edited

Legend:

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

    r46167 r46169  
    681681
    682682        wp_default_scripts( $wp_scripts );
     683        wp_default_packages( $wp_scripts );
    683684
    684685        $wp_scripts->base_url  = '';
     
    706707
    707708        wp_default_scripts( $wp_scripts );
     709        wp_default_packages( $wp_scripts );
    708710
    709711        $wp_scripts->base_url  = '';
     
    740742        $wp_scripts->do_concat = true;
    741743
    742         $expected_tail = "<script type='text/javascript' src='/customize-dependency.js'></script>\n";
     744        $expected_tail  = "<script type='text/javascript' src='/customize-dependency.js'></script>\n";
    743745        $expected_tail .= "<script type='text/javascript'>\n";
    744746        $expected_tail .= "tryCustomizeDependency()\n";
     
    749751        wp_add_inline_script( $handle, 'tryCustomizeDependency()' );
    750752
    751         // Open a buffer to get the output of `wp_print_scripts`.
    752         ob_start();
    753753        wp_print_scripts();
    754         $print_scripts = ob_get_clean();
     754        $print_scripts = get_echo( '_print_scripts' );
    755755
    756756        $tail = substr( $print_scripts, strrpos( $print_scripts, "<script type='text/javascript' src='/customize-dependency.js'>" ) );
Note: See TracChangeset for help on using the changeset viewer.