Update how custom svg dimesions are applied for get_image_tag and wp_get_attachment_image functions
Separate the logic for defining custom dimensions in a set_svg_dimension function
Closes #6
How to test the Change
In any template output the image markup either by using get_image_tag or wp_get_attachment_image functions.
Set the custom image size to either one of the registered image size names or a custom one via array [$width, $height].
Output should match the set dimensions.
Changelog Entry
Added - added set_svg_dimension function in order to reduce repetition
Changed - changed how image dimensions were passed in get_image_tag_override and one_pixel_fix methods
@gabriel-glo thanks for the PR! Could you please fill out the PR template with description, changelog, and credits information so that we can properly review and merge this?
Description of the Change
get_image_tag
andwp_get_attachment_image
functionsset_svg_dimension
functionCloses #6
How to test the Change
In any template output the image markup either by using
get_image_tag
orwp_get_attachment_image
functions. Set the custom image size to either one of the registered image size names or a custom one via array[$width, $height]
. Output should match the set dimensions.Changelog Entry
Credits
Props @
Checklist: