I want to upload .json files in my media library in WordPress. The reason for this is that I'm using lottie animations and the output is an animated .svg file. I just want to retrieve the file url from the backend to use it in the frontend. Unfortunately .json doesn't work to import even with the usage of the following code:
function cc_mime_types($mimes) {
$mime_types = array(
'svg' => 'image/svg+xml',
'json' => 'application/json',
);
return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');
define( 'ALLOW_UNFILTERED_UPLOADS', true );
Does anyone knows a solution for this kind of problem?
Best regards!