Hi,
1. We have provided a filter ‘uwp_fields_allowed_mime_types’ which allows changing the allowed MIME types.
2. You might restrict using custom JS or customisation in the plugin.
Regards,
Patrik
Hi,
Thank you for the reply but i will need a bit more information 😉
1. Can you provide some kind of documents or tutorial on this subject? I am not a programmer and never heard of mime before. I basically want to allow only jpeg and png to be uploaded.
2. When you say in the plugin where are you referring to?
Thank you.
Hi,
You can try adding following code in functions.php file of currently active theme or via Code Snippets plugin and let me know if it helps or not:
add_filter('uwp_fields_allowed_mime_types', 'uwp_fields_allowed_mime_types_cb', 10, 2);
function uwp_fields_allowed_mime_types_cb($allowed_mime_types, $htmlvar_name){
if(in_array($htmlvar_name, array('avatar', 'banner'))) {
$allowed_mime_types = array(
'jpg',
'jpe',
'jpeg',
'png'
);
return $allowed_mime_types;
}
}
Just change the extensions as per your requirements.
Regards,
Patrik
Hi Patrick and thank you for reaching out and offering your support I appreciate it 🙂
I have added the snippet at the bottom of my theme function.php and it caused a critical error stopping the site from loading so I removed it and then I tried in wp-inlcude folder but it changed nothing, I post a link that will show you a screenshot.
https://prnt.sc/26sevqk
Thank you.