You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What are your thoughts on trying to assign the default height and width attributes based on the image size used in the wp_get_attachment_image() function?
For example, when I use the above in my template with your plugin activated my SVG is loaded with the height and width attributes set to the images default size. I, however, would like the height and width to be 78x78.
I ended up using the following filter in my theme to work around the issue... but i think this would be worth considering incorporating into the plugin.
I think this could be a great enhancement moving forward, especially taking CLS into account now.
@jeffpaul this could work by wrapping lines 471-476 in a conditional that checks for the full size and otherwise returning the size requested as above.
We should also take into account that $size may be an array rather than a string with a named size.
Hi @darylldoyle
What are your thoughts on trying to assign the default height and width attributes based on the image size used in the
wp_get_attachment_image()
function?For example, when I use the above in my template with your plugin activated my SVG is loaded with the height and width attributes set to the images default size. I, however, would like the height and width to be
78
x78
.I ended up using the following filter in my theme to work around the issue... but i think this would be worth considering incorporating into the plugin.
The text was updated successfully, but these errors were encountered: