Uses
Uses | Description |
---|---|
wp-includes/media.php: wp_lazy_loading_enabled | Filters whether to add the |
wp-includes/plugin.php: apply_filters() | Calls the callback functions that have been added to a filter hook. |
Determine whether to add the loading
attribute to the specified tag in the specified context.
(string) (Required) The tag name.
(string) (Required) Additional context, like the current filter name or the function name from where this was called.
(bool) Whether to add the attribute.
File: wp-includes/media.php
function wp_lazy_loading_enabled( $tag_name, $context ) { // By default add to all 'img' tags. // See https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-loading $default = ( 'img' === $tag_name ); /** * Filters whether to add the `loading` attribute to the specified tag in the specified context. * * @since 5.5.0 * * @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) apply_filters( 'wp_lazy_loading_enabled', $default, $tag_name, $context ); }
Version | Description |
---|---|
5.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_lazy_loading_enabled