Make WordPress Core

Opened 3 years ago

Closed 4 months ago

#51856 closed defect (bug) (worksforme)

loading="lazy" attribute bug

Reported by: lovor's profile lovor Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.5.3
Component: Media Keywords: close
Focuses: template Cc:

Description

Adding of loading="lazy" attribute cannot be prevented; even when placing

add_filter( 'wp_lazy_loading_enabled', '__return_false' );

in functions.php. Further, loading="lazy" is added to all images, event to images in page templates (e.g. header.php), which already have loading="eager" attribute.

Change History (3)

#1 @SergeyBiryukov
3 years ago

  • Component changed from General to Media

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


2 years ago

#3 @Mista-Flo
4 months ago

  • Keywords close added; needs-patch removed
  • Resolution set to worksforme
  • Status changed from new to closed

Can't reproduce, I tried to add the filter in a mu-plugin for example, and the lazy load attribute was properly removed.

Note: See TracTickets for help on using tickets.