[wp-trac] [WordPress Trac] #45407: Add block attributes to `wp_calculate_image_sizes` to allow for proper handling of `sizes` attribute
WordPress Trac
noreply at wordpress.org
Mon Jan 21 08:55:42 UTC 2019
#45407: Add block attributes to `wp_calculate_image_sizes` to allow for proper
handling of `sizes` attribute
--------------------------+------------------------
Reporter: mor10 | Owner: joemcgill
Type: defect (bug) | Status: assigned
Priority: high | Milestone: 5.2
Component: Media | Version:
Severity: major | Resolution:
Keywords: dev-feedback | Focuses:
--------------------------+------------------------
Comment (by azaozz):
> Another potential approach would be to modify the regex...
Yeah, looked at that too but it would be a (hacky) fix on top of another
hacky fix (parsing HTML with regex) on top of another... :)
Yet another possible approach would be to not regenerate all the image
block HTML, just run it through a filter with all the extra image data as
params. But then a theme or a plugin will still have to regenerate it or
parse it and replace attributes with regex.
There is even an option to add the available image data at time of editing
as attributes to the `<img>` tag and leave it all to themes/plugins to
handle. Somehow not thinking that'd be good.
Thinking best would be to take a step back and reevaluate the scope of
this ticket. We have the time now, it is for WP 5.2 :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45407#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list