Created
August 27, 2021 13:43
-
-
Save Korveld/77f4bc9dca3d80a7fc55530cfe7a04e4 to your computer and use it in GitHub Desktop.
Add version to all svg images in wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'the_content', 'img_src_replace', 20 ); | |
| function img_src_replace($content) { | |
| return str_replace('.svg', '.svg?v=2', $content); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment