wp_get_loading_optimization_attributes filter-hookWP 6.4.0

Filters the loading optimization attributes.

Usage

add_filter( 'wp_get_loading_optimization_attributes', 'wp_kama_get_loading_optimization_attributes_filter', 10, 4 );

/**
 * Function for `wp_get_loading_optimization_attributes` filter-hook.
 * 
 * @param array  $loading_attrs The loading optimization attributes.
 * @param string $tag_name      The tag name.
 * @param array  $attr          Array of the attributes for the tag.
 * @param string $context       Context for the element for which the loading optimization attribute is requested.
 *
 * @return array
 */
function wp_kama_get_loading_optimization_attributes_filter( $loading_attrs, $tag_name, $attr, $context ){

	// filter...
	return $loading_attrs;
}
$loading_attrs(array)
The loading optimization attributes.
$tag_name(string)
The tag name.
$attr(array)
Array of the attributes for the tag.
$context(string)
Context for the element for which the loading optimization attribute is requested.

Changelog

Since 6.4.0 Introduced.

Where the hook is called

wp_get_loading_optimization_attributes()
wp_get_loading_optimization_attributes
wp-includes/media.php 5938
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5752
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5758
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5774
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5793
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );

Where the hook is used in WordPress

Usage not found.