wp_high_priority_element_flag( bool $value = null ): bool

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Accesses a flag that indicates if an element is a possible candidate for fetchpriority='high'.

Parameters

$valuebooloptional
Used to change the static variable.

Default:null

Return

bool Returns true if high-priority element was marked already, otherwise false.

Source

if ( $maybe_in_viewport ) {
	$loading_attrs = wp_maybe_add_fetchpriority_high_attr( $loading_attrs, $tag_name, $attr );
} else {
	// Only add `loading="lazy"` if the feature is enabled.
	if ( wp_lazy_loading_enabled( $tag_name, $context ) ) {
		$loading_attrs['loading'] = 'lazy';
	}
}

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.