sergioC-13
Admite hilos creados en los últimos 30 días: 0
Debates favoritos del foro
Este usuario no tiene debates favoritos.
Temas del foro creados
| Status | Debate | Supporter | Voces | Mensajes | Caducidad |
|---|---|---|---|---|---|
|
custom field type file validation
Iniciado por: sergioC-13
en: 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 | 3 years ago | |
|
html toolset forms reset after update
Iniciado por: sergioC-13 en: Toolset Professional Support |
2 | 3 | 3 years, 1 month ago | ||
|
issue with a index in multilang page
Iniciado por: sergioC-13 en: Toolset Professional Support |
|
3 | 7 | 3 years, 7 months ago | |
|
Getting constantly errors in the editor side as "invalid Json"
Iniciado por: sergioC-13 en: Toolset Professional Support |
|
2 | 3 | 3 years, 7 months ago | |
|
wpv-reset-password-form shortcode
Iniciado por: sergioC-13 en: Toolset Professional Support |
|
2 | 3 | 3 years, 9 months ago | |
|
error trying to save changes in the "No items found text" in the views
Iniciado por: sergioC-13 en: Toolset Professional Support |
|
2 | 8 | 3 years, 9 months ago | |
|
Save user data in a CPT after edit profile using Cred forms
Iniciado por: sergioC-13 en: Toolset Professional Support |
|
2 | 3 | 3 years, 10 months ago |