[wp-trac] [WordPress Trac] #34678: Responsive Images: Check if content images already have a sizes attribute

WordPress Trac noreply at wordpress.org
Fri Nov 13 21:09:22 UTC 2015


#34678: Responsive Images: Check if content images already have a sizes attribute
----------------------------+-----------------------------
 Reporter:  jaspermdegroot  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Media           |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 If someone adds a custom `sizes` attribute in the post editor but no
 `srcset` attribute, the image will get filtered because we only check if
 there already is a `srcset` attribute in
 `wp_make_content_images_responsive()` before calling
 `wp_image_add_srcset_and_sizes()`. As a result the image will get two
 `sizes` attributes. We should check if the image already has a `sizes`
 attribute before adding it.

 I have created a fix for this in RICG Responsive Images plugin repo. It's
 currently being reviewed. I will attach a patch here shortly.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34678>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list