I believe you can add a filter to upload_mimes
to restrict to certain types. The upload_mimes
hook:
1 2 3 4 5 6 7 8 9 10 |
add_filter('upload_mimes','restict_mime'); function restict_mime($mimes) { $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', ); return $mimes; } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.