Allow uploads to specified file types by roles
-
Hi, I restrict uploads to specified file types only (jpg, gif, png) using a code I added to my functions.php:
add_filter('upload_mimes','restrict_mime'); function restrict_mime($mimes) { $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', ); return $mimes; }
Now I would like to also allow mp3 files to be uploaded but only by admin and editor roles. I have tried some code by my own with no success at all, if you know how to do it, thank you very much for your help! ??
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Allow uploads to specified file types by roles’ is closed to new replies.