[wp-trac] [WordPress Trac] #58895: Make it easier to override default loading optimizations
WordPress Trac
noreply at wordpress.org
Mon Sep 25 09:50:29 UTC 2023
#58895: Make it easier to override default loading optimizations
-------------------------+--------------------------
Reporter: joemcgill | Owner: (none)
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.5
Component: Media | Version: 6.3
Severity: normal | Resolution: duplicate
Keywords: needs-patch | Focuses: performance
-------------------------+--------------------------
Changes (by thekt12):
* status: new => closed
* resolution: => duplicate
Comment:
Newly introduced filter `pre_wp_get_loading_optimization_attributes` in
#58893 is able to disable optimization logic completely without the side
effects mentioned in the description.
Test code to disable optimization logic.
{{{
add_filter( 'pre_wp_get_loading_optimization_attributes',
'disable_wp_get_loading_optimization_attributes' );
function disable_wp_get_loading_optimization_attributes( $loading_attr ) {
return array();
}
}}}
The same filter can be used to set any value for `loading` and
`fetchpriority` enabling overriding of the default value.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58895#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list