Did something change in how adding filetypes works with CP?

#1

I used this function to be able to upload svg

function cc_mime_types($mimes) {
$mimes[‘svg’] = ‘image/svg+xml’;
return $mimes;
}
add_filter(‘upload_mimes’, ‘cc_mime_types’);

But it no longer works. Is this a CP thing or?

0 Likes

#2

I guess not, can you double check if the quotes are correct? sometimes copy/paste can cause some damage.

The code worked fine for me.
CloudApp

0 Likes

#3

Yes, looks to me like you have smart quotes in there? Would that break things?

0 Likes

#4

I have rewritten the entire function by hand and it’s still not working. debugging is also not giving an error_log

0 Likes

#5

We have found the solution. It wasn’t the code. We needed to add this to the SVG’s themselves

<?xml version="1.0" encoding="utf-8"?>
1 Like

#6

This was probably part of the changes in WordPress 4.9.9 and 5.0.1.

0 Likes

closed #7

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

0 Likes