Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hey, I actually just got done implementing this for my own site. Here is a gist for a WordPress filter that will replace svg-img tags with the inline SVG code from the sourced file when the page loads. It’s coded to only work on locally-hosted SVG files stored in your WordPress content folder and it runs the code through @enshrined’s svg-sanitizer library (which must be installed) just in case the SVG got uploaded to the site by some means that avoids this plugin (an integrated forum’s posts, for example).

    To use this, paste the entire code into your theme’s functions.php or get a plugin like code snippets and add it as a snippet to that.

    • This reply was modified 6 years, 6 months ago by jadeddragoon. Reason: forgot the link, derp
    • This reply was modified 6 years, 6 months ago by jadeddragoon.
    • This reply was modified 6 years, 6 months ago by jadeddragoon.
Viewing 1 replies (of 1 total)