wp_omit_loading_attr_threshold хук-фильтрWP 5.9.0

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.

Использование

add_filter( 'wp_omit_loading_attr_threshold', 'wp_kama_omit_loading_attr_threshold_filter' );

/**
 * Function for `wp_omit_loading_attr_threshold` filter-hook.
 * 
 * @param int $omit_threshold The number of media elements where the `loading` attribute will not be added.
 *
 * @return int
 */
function wp_kama_omit_loading_attr_threshold_filter( $omit_threshold ){

	// filter...
	return $omit_threshold;
}
$omit_threshold(int)
The number of media elements where the loading attribute will not be added.
По умолчанию: 1

Список изменений

С версии 5.9.0 Введена.

Где вызывается хук

wp_omit_loading_attr_threshold()
wp_omit_loading_attr_threshold
wp-includes/media.php 5379
$omit_threshold = apply_filters( 'wp_omit_loading_attr_threshold', 1 );

Где используется хук в WordPress

Использование не найдено.