Tell us what you are trying to do?
My CRED form is only allowing .jpg and .png extensions on uploaded files. Can you tell me how to force it to accept other mime types? I can see how to further restrict it but not how to override restrictions
Is there any documentation that you are following?
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
Is there a similar example that we can see?
What is the link to your site?
transportationmanagement.us/mndot
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
To allow or customize the mime types, you can use the native WordPress hook upload_mimes to add more mime types:
=> https://developer.wordpress.org/reference/hooks/upload_mimes/
For Example:
You can customize the following code as per your requirement.
function my_custom_mime_types( $mimes ) {
// New allowed mime types.
$mimes['svg'] = 'image/svg+xml';
$mimes['svgz'] = 'image/svg+xml';
$mimes['doc'] = 'application/msword';
// Optional. Remove a mime type.
unset( $mimes['exe'] );
return $mimes;
}
add_filter( 'upload_mimes', 'my_custom_mime_types' );
You can add such custom code at:
=> Toolset > Settings > Custom code
More info:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/