wp_lazy_loading_enabled
Filters whether to add the loading attribute to the specified tag in the specified context.
Usage
add_filter( 'wp_lazy_loading_enabled', 'wp_kama_lazy_loading_enabled_filter', 10, 3 ); /** * Function for `wp_lazy_loading_enabled` filter-hook. * * @param bool $default Default value. * @param string $tag_name The tag name. * @param string $context Additional context, like the current filter name or the function name from where this was called. * * @return bool */ function wp_kama_lazy_loading_enabled_filter( $default, $tag_name, $context ){ // filter... return $default; }
- $default(true|false)
- Default value.
- $tag_name(string)
- The tag name.
- $context(string)
- Additional context, like the current filter name or the function name from where this was called.
Changelog
Since 5.5.0 | Introduced. |
Where the hook is called
wp_lazy_loading_enabled
wp-includes/media.php 1841
return (bool) apply_filters( 'wp_lazy_loading_enabled', $default, $tag_name, $context );