-
Notifications
You must be signed in to change notification settings - Fork 7
Why not use wordpress markup for images? #66
Comments
I definitely support making it easier to use the native responsive image markup generation. I'm not entirely sure of the best way to do that. What if there was a filter around the |
This is the first step in the future. No one knows when and how the new features will be added. We can add new filters to change the layout in the plugin. At the same time, the WP features already allow you to do the same. All this makes support more difficult, but it does not solve the issue of versatility. The link above has added new examples. there may be an example that can not be solved through a standard mechanism. At the moment, I do not understand what the problem solves the excessive number of filters and own markup by plugin |
The example has been updated. Now the code has the maximum opportunity to customize the output:
The use of some attributes is filtered to prevent conflicts For attachments output using the standard features of WP Сlose to the balance between WP ecosystem and customization |
There are a lot of good ideas in the gist file you provided. Would you be willing to make a PR so that we can iterate through it? I didn't realize at first that I think the filters you have in place on the attributes for the image tag and the link tag are helpful, but I found it necessary to allow for filtering the entire output at several steps along the HTML generation process; thats what the weirdly named output filters For example, one of the main use cases we have is appending a credit field immediately after the image or the the link around the image, but inside the caption markup. That wouldn't be trivial to do in the revised callback function as you've written it. |
WordPress 4.4 will add native responsive image support by including srcset and sizes attributes to the image markup it generates: https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/
Example output by native WP Markup: https://gist.github.com/vralle/a74c5878d85fe222904d
The text was updated successfully, but these errors were encountered: