sergioC-13
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
custom field type file validation
Started by: sergioC-13
in: Toolset Professional Support
Problem: I am having an issue with restricting file types to PDF and DOCX in a custom form on my WordPress website. The file type validation code I am using does not seem to work. Solution: Go to the Form edit screen and uncheck "Use the WordPress Media Library manager for image, video, audio, or file fields". Then, use the following code snippet by adding it to your theme's functions.php file or a custom plugin: add_filter('cred_form_validate', 'cred_filetype_size_validation', 10, 2); function cred_filetype_size_validation($field_data, $form_data) { list($fields, $errors) = $field_data; if (14 == $form_data['id']) { $file_type_uploaded = $_FILES['wpcf-documento-obra-escritor']['type']; if (!('application/pdf' == $file_type_uploaded) || ($file_type_uploaded == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')) { $errors['documento-obra-escritor'] = 'Sorry, the file you have uploaded is not of the correct type.'; } } return array($fields, $errors); } Make sure to replace 14 with your form's actual ID. Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate |
|
2 | 7 | 2 years, 3 months ago | |
html toolset forms reset after update
Started by: sergioC-13 in: Toolset Professional Support |
2 | 3 | 2 years, 4 months ago | ||
issue with a index in multilang page
Started by: sergioC-13 in: Toolset Professional Support |
|
3 | 7 | 2 years, 9 months ago | |
Getting constantly errors in the editor side as "invalid Json"
Started by: sergioC-13 in: Toolset Professional Support |
|
2 | 3 | 2 years, 9 months ago | |
wpv-reset-password-form shortcode
Started by: sergioC-13 in: Toolset Professional Support |
|
2 | 3 | 2 years, 11 months ago | |
error trying to save changes in the "No items found text" in the views
Started by: sergioC-13 in: Toolset Professional Support |
|
2 | 8 | 2 years, 11 months ago | |
Save user data in a CPT after edit profile using Cred forms
Started by: sergioC-13 in: Toolset Professional Support |
|
2 | 3 | 3 years ago |