Skip to content
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

<img/> tags missing attribute filter #2258

Closed
jsmoriss opened this issue Aug 7, 2017 · 4 comments
Closed

<img/> tags missing attribute filter #2258

jsmoriss opened this issue Aug 7, 2017 · 4 comments
Labels
[Feature] Media Anything that impacts the experience of managing media [Status] Not Applicable Issue outside Gutenberg, is not a bug, or is a support request.

Comments

@jsmoriss
Copy link

jsmoriss commented Aug 7, 2017

The HTML tags added to blocks are missing an attribute filter. The 'wp_get_attachment_image_attributes' filter should be applied to the image attributes for compatibility with WordPress.

@karmatosed karmatosed added [Feature] Media Anything that impacts the experience of managing media [Type] Question Questions about the design or development of the editor. labels Aug 7, 2017
@danielbachhuber danielbachhuber added Backwards Compatibility Issues or PRs that impact backwards compatability and removed [Type] Question Questions about the design or development of the editor. labels Jan 23, 2018
@danielbachhuber danielbachhuber added this to the Merge Proposal milestone Apr 10, 2018
@karmatosed karmatosed modified the milestones: Merge Proposal, Merge Proposal: Media Apr 12, 2018
@gziolo gziolo added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Jun 11, 2018
@mtias mtias modified the milestones: Merge: Media, WordPress 5.0 Oct 3, 2018
@antpb
Copy link
Contributor

antpb commented Oct 5, 2018

From the media meeting yesterday @joemcgill mentioned "Gutenberg uses a different markup structure entirely with a different filtering process. I think we would be better off writing upgrade notes that explains how to do this correctly going forward, but am open to solutions that allow back-compat of the previous filter if we can come up with an approach."

I think with that, we can shift our focus on providing an upgrade path for folks that depend on the filter. What should they do now if we choose to not respect the filter?

@joemcgill
Copy link
Member

joemcgill commented Oct 26, 2018

Following up after we discussed this again in the Core Media meeting yesterday and after doing a bit more research this morning. Traditionally, image markup in the editor was composed server side, via get_image_send_to_editor() which uses get_image_tag() under the hood. Neither of these functions apply the wp_get_attachment_image_attributes filter, so this issue really isn't valid as described. The wp_get_attachment_image_attributes filter only applies to image markup that is dynamically generated on the front end, e.g., featured images, gallery shortcodes (see #1451), etc.

That said, supporting backward compatibility for filters like image_send_to_editor, get_image_tag_class, and get_image_tag, which previously did provide a way for themes and plugins to modify the markup of images in the editor, would be a good goal for this ticket.

@danielbachhuber
Copy link
Member

danielbachhuber commented Oct 26, 2018

That said, supporting backward compatibility for filters like image_send_to_editor, get_image_tag_class, and get_image_tag, which previously did provide a way for themes and plugins to modify the markup of images in the editor, would be a good goal for this ticket.

For image_send_to_editor, see #8472

However, this is also impacted by #10204

@joemcgill
Copy link
Member

joemcgill commented Oct 26, 2018

Ah, thanks @danielbachhuber, I'd missed that ticket. Since that already exists, I'm going to close this one and move the other to (leave it in) the 5.0 milestone for review.

@joemcgill joemcgill added [Status] Not Applicable Issue outside Gutenberg, is not a bug, or is a support request. and removed Backwards Compatibility Issues or PRs that impact backwards compatability Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Status] Not Applicable Issue outside Gutenberg, is not a bug, or is a support request.
Projects
None yet
Development

No branches or pull requests

7 participants