Make WordPress Core


Ignore:
Timestamp:
06/28/2023 02:14:58 PM (3 years ago)
Author:
azaozz
Message:

Script Loader: Fix unintended adding of async to scripts that are printed directly with wp_print_scripts() without enqueueing them beforehand.

Props: joemcgill, westonruter, felixarntz, peterwilsoncc.
See: #58648.

File:
1 edited

Legend:

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

    r56033 r56092  
    29332933
    29342934        /**
     2935         * Ensure tinymce scripts aren't loading async.
     2936         *
     2937         * @ticket 58648
     2938         */
     2939        public function test_printing_tinymce_scripts() {
     2940                global $wp_scripts;
     2941
     2942                wp_register_tinymce_scripts( $wp_scripts, true );
     2943
     2944                $actual = get_echo( 'wp_print_scripts', array( array( 'wp-tinymce' ) ) );
     2945
     2946                $this->assertStringNotContainsString( 'async', $actual );
     2947        }
     2948
     2949        /**
    29352950         * Parse an HTML markup fragment.
    29362951         *
Note: See TracChangeset for help on using the changeset viewer.