Opened 5 years ago
Closed 5 years ago
#53463 closed defect (bug) (fixed)
Lazy loading attribute not adding to images in block based widgets
| Reported by: | spacedmonkey | Owned by: | flixos90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.8 |
| Component: | Widgets | Version: | 5.8 |
| Severity: | normal | Keywords: | has-patch has-unit-tests commit |
| Cc: | Focuses: |
Description
If I insert an image or paragraph / custom html ( that contains html for an image ), in the new block based widget screen, the generated image on the front end does contain the loading="lazy" attribute. See attached screenshot.
Attachments (1)
Change History (10)
#1
@
5 years ago
- Summary Lazy loading images not working in block based widgets → Lazy loading attribute not adding to images in block based widgets
This ticket was mentioned in Slack in #core-media by spacedmonkey. View the logs.
5 years ago
This ticket was mentioned in PR #1401 on WordPress/wordpress-develop by walbo.
5 years ago
#4
- Keywords has-patch has-unit-tests added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/53463
This ticket was mentioned in PR #1404 on WordPress/wordpress-develop by spacedmonkey.
5 years ago
#6
#7
@
5 years ago
Confirmed that the issue is present and tested the patch. Works as expected.
Markup Before:
https://d.pr/i/nIRRgg
Markup After
https://d.pr/i/sim5Yf
#8
@
5 years ago
- Keywords commit added
- Owner set to
- Status new → reviewing
Thanks @daisyo for the testing! Both PRs fix it correctly, but https://github.com/WordPress/wordpress-develop/pull/1401 also has a little test coverage. This is ready for commit.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I should just be a matter of running
add_filter( 'widget_block_content', 'wp_filter_content_tags' );