[wp-trac] [WordPress Trac] #12009: Add support for HTML 5 "async" and "defer" attributes
WordPress Trac
noreply at wordpress.org
Mon Jun 26 13:40:47 UTC 2023
#12009: Add support for HTML 5 "async" and "defer" attributes
-------------------------------------------------+-------------------------
Reporter: Otto42 | Owner: 10upsimon
Type: enhancement | Status: closed
Priority: high | Milestone: 6.3
Component: Script Loader | Version: 4.6
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests commit | Focuses:
2nd-opinion | performance
-------------------------------------------------+-------------------------
Changes (by joemcgill):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"56033" 56033]:
{{{
#!CommitTicketReference repository="" revision="56033"
Script Loader: Add support for HTML 5 "async" and "defer" attributes.
This allows developers to register scripts with an intended loading
strategy by changing the `$in_footer` parameter of `wp_register_script`
and `wp_enqueue_script` to an array that accepts both an `in_footer` and
`strategy` argument. If present, the loading strategy attribute will be
added to the script tag when that script is printed to the page as long as
it is not a dependency of any blocking scripts, including any inline
scripts attached to the script or any of its dependents.
Props 10upsimon, thekt12, westonruter, costdev, flixos90, spacedmonkey,
adamsilverstein, azaozz, mukeshpanchal27, mor10, scep, wpnook, vanaf1979,
Otto42.
Fixes #12009.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/12009#comment:141>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list