apply_filters( 'wp_get_loading_optimization_attributes', array $loading_attrs, string $tag_name, array $attr, string $context )
- Since
- 6.4.0
Filters the loading optimization attributes.
Compatibility
- WordPress
- since 6.4.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$loading_attrsarray- The loading optimization attributes.
$tag_namestring- The tag name.
$attrarray- Array of the attributes for the tag.
$contextstring- Context for the element for which the loading optimization attribute is requested.
Where this hook fires · 5
wp-includes/media.php:6180wp_get_loading_optimization_attributes()wp-includes/media.php:6186wp_get_loading_optimization_attributes()wp-includes/media.php:6202wp_get_loading_optimization_attributes()wp-includes/media.php:6217wp_get_loading_optimization_attributes()wp-includes/media.php:6395wp_get_loading_optimization_attributes()
Source code
* * @param array $loading_attrs The loading optimization attributes. * @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. */ return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );} /** * Gets the threshold for how many of the first content media elements to not lazy-load. * * This function runs the {@see 'wp_omit_loading_attr_threshold'} filter, which uses a default threshold value of 3.Changelog
Introduced in 6.4.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.