Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#48706 closed defect (bug) (invalid)

Post export does not include srcset attributes

Reported by: rogeriomoreira's profile rogeriomoreira Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.3
Component: Export Keywords:
Focuses: Cc:

Description

Hi.

Since version 4.4, WordPress adds native responsive image support by including srcset and sizes attributes to the image markup it generates. However, when exporting the posts with the WordPress export built-in functionality these attributes are not included on the XML file.

Steps to reproduce:

  1. Create a new post containing one image;
  2. Inspect the post on the front-end and make sure the srcset and size attributes are there;
  3. Export the posts with the WordPress built-in functionality;
  4. In the XML file, these attributes are not there.

Happy to contribute with anything.

Change History (3)

#1 follow-up: @SergeyBiryukov
5 years ago

Hi there, welcome to WordPress Trac! Thanks for the report.

This is probably intentional, as srcset and sizes attributes are added by wp_make_content_images_responsive() at runtime via the_content filter, and are not saved to the database. This makes it easier to update image sizes for uploaded files in the future and regenerate thumbnails as needed.

#2 in reply to: ↑ 1 @rogeriomoreira
5 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Replying to SergeyBiryukov:

Hi there, welcome to WordPress Trac! Thanks for the report.

This is probably intentional, as srcset and sizes attributes are added by wp_make_content_images_responsive() at runtime via the_content filter, and are not saved to the database. This makes it easier to update image sizes for uploaded files in the future and regenerate thumbnails as needed.

Thanks. Didn't know about that filter, everything makes sense now :)

#3 @desrosj
5 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.