W3cubDocs

/WordPress

apply_filters( ‘wp_omit_loading_attr_threshold’, int $omit_threshold )

Filters the threshold for how many of the first content media elements to not lazy-load.

Description

For these first content media elements, the loading attribute will be omitted. By default, this is the case for only the very first content media element.

Parameters

$omit_thresholdint
The number of media elements where the loading attribute will not be added. Default 3.

Source

$maybe_in_viewport = true;

Changelog

Version Description
6.3.0 The default threshold was changed from 1 to 3.
5.9.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_omit_loading_attr_threshold