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

Comments

Projects
None yet
7 participants
@jsmoriss
Copy link

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.

@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

@mtias mtias modified the milestones: Merge: Media, WordPress 5.0 Oct 3, 2018

@antpb

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.