Filter hook 'wp_omit_loading_attr_threshold'

in WP Core File wp-includes/media.php at line 5969

Description

Filters the threshold for how many of the first content media elements to not lazy-load. 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.

Occurrences

Filename Line Number
wp-includes/media.php 5969

Parameters

Type Name Description
int $omit_threshold The number of media elements where the `loading` attribute will not be added. Default 3.

PHP Doc

/**
		 * Filters the threshold for how many of the first content media elements to not lazy-load.
		 *
		 * 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.
		 *
		 * @since 5.9.0
		 * @since 6.3.0 The default threshold was changed from 1 to 3.
		 *
		 * @param int $omit_threshold The number of media elements where the `loading` attribute will not be added. Default 3.
		 */