wp_iframe_tag_add_loading_attr хук-фильтрWP 5.7.0

Filters the loading attribute value to add to an iframe. Default lazy.

Returning false or an empty string will not add the attribute. Returning true will add the default value.

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

add_filter( 'wp_iframe_tag_add_loading_attr', 'wp_kama_iframe_tag_add_loading_attr_filter', 10, 3 );

/**
 * Function for `wp_iframe_tag_add_loading_attr` filter-hook.
 * 
 * @param string|bool $value   The `loading` attribute value. Returning a falsey value will result in the attribute being omitted for the iframe.
 * @param string      $iframe  The HTML `iframe` tag to be filtered.
 * @param string      $context Additional context about how the function was called or where the iframe tag is.
 *
 * @return string|bool
 */
function wp_kama_iframe_tag_add_loading_attr_filter( $value, $iframe, $context ){

	// filter...
	return $value;
}
$value(строка|true|false)
The loading attribute value. Returning a falsey value will result in the attribute being omitted for the iframe.
$iframe(строка)
The HTML iframe tag to be filtered.
$context(строка)
Additional context about how the function was called or where the iframe tag is.

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

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

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

wp_iframe_tag_add_loading_attr()
wp_iframe_tag_add_loading_attr
wp-includes/media.php 2238
$value = apply_filters( 'wp_iframe_tag_add_loading_attr', $value, $iframe, $context );

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

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