Disable lazy-loading iframe within post content in WordPress 5.7

Disable lazy-loading iframe within post content in WordPress 5.7 on your child site.

Snippet Type

Execute on Child Sites

Snippet

function disable_post_content_iframe_lazy_loading( $default, $tag_name, $context ) {
    if ( 'iframe' === $tag_name && 'the_content' === $context ) {
        return false;
    }
    return $default;
}
add_filter(
    'wp_lazy_loading_enabled',
    'disable_post_content_iframe_lazy_loading',
    10,
    3
);