Created
August 8, 2025 08:33
-
-
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
This file contains hidden or 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 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