Snippets repository for WordPress developpers

Browse
// into functions.php
<?php
function sp_enable_svg_upload( $mimes ) {
  //For security reasons only admin can uplaod svg files
  if ( !current_user_can( 'administrator' ) ) {
    return $mimes;
  }
  $mimes['svg']  = 'image/svg+xml';
  $mimes['svgz'] = 'image/svg+xml';
  return $mimes;
}
add_filter('upload_mimes', 'sp_enable_svg_upload');
?>

Or use Daryll Doyle Safe SVG plugin.


Warning: Trying to access array offset on null in /home/clients/7f7a8d8eb6e40c50d3548b06c548734d/web/wp-includes/class-wp-query.php on line 3766

Categories

Tags