-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't override sizes
attributes set in the post editor
#227
Comments
The WordPress Trac ticket for reference: https://core.trac.wordpress.org/ticket/34678 |
The only time this will be an issue is when someone adds a manual I'm a bit concerned that Seems like we should be consistent in the way these are handled but there's some tradeoffs. If we add a |
Yeah, I have been thinking about this too. At first I also thought we should check both in I agree that adding only a |
This is true. And since this is a content filter, we should favor efficiency over covering hypothetical edge cases. Commit looks good. |
Check if there is no sizes attribute before adding it (Resolves #227)
If a user sets a custom
sizes
attribute in the post editor but nosrcset
attribute, the image will get filtered because we only check forsrcset
attributes inwp_make_content_images_responsive
before passing them off towp_image_add_srcset_and_sizes
. We don't do any sanity checking inwp_image_add_srcset_and_sizes
, so a duplicate sizes attribute will get added.Example:
Compiles to:
See: https://wordpress.org/support/topic/set-custom-sizes-attribute-on-img-in-the-post-editor
The text was updated successfully, but these errors were encountered: