wp_get_loading_optimization_attributes
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-includes/media.php 5942
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5756
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5762
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5778
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );
wp-includes/media.php 5797
return apply_filters( 'wp_get_loading_optimization_attributes', $loading_attrs, $tag_name, $attr, $context );