-
-
Save Asikur22/6e19bcc50b483c811d19f6b55759beda to your computer and use it in GitHub Desktop.
Allow SVGs in WordPress media library
This file contains 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
function upload_svg_files( $allowed ) { | |
if ( !current_user_can( 'manage_options' ) ) | |
return $allowed; | |
$allowed['svg'] = 'image/svg+xml'; | |
return $allowed; | |
} | |
add_filter( 'upload_mimes', 'upload_svg_files'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment