10up / safe-svg

Enable SVG uploads and sanitize them to stop XML/SVG vulnerabilities in your WordPress website.
https://wordpress.org/plugins/safe-svg/
GNU General Public License v2.0
263 stars 31 forks source link

Update how custom svg dimesions are applied #216

Open gabriel-glo opened 1 month ago

gabriel-glo commented 1 month ago

Description of the Change

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

Credits

Props @

Checklist:

github-actions[bot] commented 1 month ago

@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?