Make WordPress Core


Ignore:
Timestamp:
07/17/2023 02:04:00 PM (2 years ago)
Author:
joemcgill
Message:

Script Loader: Improve test coverage for wp_print_scripts().

This is a follow-up to [56092], which further improves PHPUnit test coverage and inline docs for ensuring async and defer attributes are being properly handled for scripts that are printed without being enqueued.

Props peterwilsoncc, azaozz, westonruter, joemcgill.
See #58648.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-scripts.php

    r56092 r56246  
    915915        }
    916916
    917         // If the intended strategy is 'defer', limit the initial list of eligibles.
     917        /*
     918         * If the intended strategy is 'defer', limit the initial list of eligible
     919         * strategies, since 'async' can fallback to 'defer', but not vice-versa.
     920         */
    918921        $initial = ( 'defer' === $intended ) ? array( 'defer' ) : null;
    919922
Note: See TracChangeset for help on using the changeset viewer.