How to restrict the file type for uploads?

add_filter('upload_mimes','restrict_mime'); 
function restrict_mime($mimes) { 
if ( ! current_user_can( 'manage_options' ) ) {
$mimes = array( 
                'jpg|jpeg|jpe' => 'image/jpeg', 
                'png' => 'image/png', 
        'pdf' => 'application/pdf'
);
}
return $mimes;
}
Without cookies
This website does not use cookies or tracking. More information can be found in the privacy policy.