Created
January 15, 2020 20:07
-
-
Save alexander-young/fe022c86fb820984d67d014b58e8da83 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