Skip to content

Instantly share code, notes, and snippets.

@annuman97
Created August 8, 2025 08:33
Show Gist options
  • Select an option

  • Save annuman97/a627d4ff8d614a9ce65b7de3769bd10b to your computer and use it in GitHub Desktop.

Select an option

Save annuman97/a627d4ff8d614a9ce65b7de3769bd10b to your computer and use it in GitHub Desktop.
By default Wordpress doesn't allow SVG upload for security reason. But if someone wants to support SVG upload in community portal, first it needs to support to the WordPress and then use the fluent community hook
function allow_svg_uploads($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
add_filter('upload_mimes', 'allow_svg_uploads');
add_filter('fluent_community/support_attachment_types', function($types) {
$types[] = 'image/svg+xml';
return $types;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment