Enable display of Scalable Vector Graphics (SVG) in the WordPress media library.
As of WordPress 4.7 the media library does not display Scalable Vector Graphics (SVG) correctly. We aim to fix that.
The Scalable Vector Graphics plugin solves this nicely, but what if you want to include this functionality in your own theme or plugin?
Ah, the same good stuff as a Composer dependency!
composer require press-bits/media-library-svg-display
to the requirements in your
In your bootstrap code, after including
The original plugin also enables uploads of SVGs, but this package does not. One reason is to limit the responsbilitiy of the package, another is the security risk of SVG uploads.
A separate package based on the Safe SVG plugin may be in order.