Filter hook 'wp_get_loading_optimization_attributes'
in WP Core File wp-includes/media.php at line 5752
Description
Filters whether to short-circuit loading optimization attributes. Returning an array from the filter will effectively short-circuit the loading of optimization attributes, returning that value instead.
Occurrences
Filename |
Line Number |
wp-includes/media.php |
5752 |
wp-includes/media.php |
5758 |
wp-includes/media.php |
5774 |
wp-includes/media.php |
5793 |
wp-includes/media.php |
5938 |
Parameters
Type |
Name |
Description |
array|false |
$loading_attrs |
False by default, or array of loading optimization attributes to short-circuit. |
string |
$tag_name |
The tag name. |
array |
$attr |
Array of the attributes for the tag. |
string |
$context |
Context for the element for which the loading optimization attribute is requested. $loading_attrs = apply_filters( 'pre_wp_get_loading_optimization_attributes', false, $tag_name, $attr, $context ); if ( is_array( $loading_attrs ) ) { return $loading_attrs; } $loading_attrs = array(); /* Skip lazy-loading for the overall block template, as it is handled more granularly. The skip is also applicable for `fetchpriority`. |
PHP Doc
/**
* Filters whether to short-circuit loading optimization attributes.
*
* Returning an array from the filter will effectively short-circuit the loading of optimization attributes,
* returning that value instead.
*
* @since 6.4.0
*
* @param array|false $loading_attrs False by default, or array of loading optimization attributes to short-circuit.
* @param string $tag_name The tag name.
* @param array $attr Array of the attributes for the tag.
* @param string $context Context for the element for which the loading optimization attribute is requested.
*/
$loading_attrs = apply_filters( 'pre_wp_get_loading_optimization_attributes', false, $tag_name, $attr, $context );
if ( is_array( $loading_attrs ) ) {
return $loading_attrs;
}
$loading_attrs = array();
/*
* Skip lazy-loading for the overall block template, as it is handled more granularly.
* The skip is also applicable for `fetchpriority`.
*/