sergioC-13
Fils de soutien créés au cours des 30 derniers jours : 0
Sujets de forum favoris
This user has no favorite topics.
Sujets de forum créés
| Status | Topic | Supporter | Voix | Publications | Nouveauté |
|---|---|---|---|---|---|
|
custom field type file validation
Commencé par : 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 | Il y a 3 years | |
|
html toolset forms reset after update
Commencé par : sergioC-13 in: Toolset Professional Support |
2 | 3 | Il y a 3 years, 1 month | ||
|
issue with a index in multilang page
Commencé par : sergioC-13 in: Toolset Professional Support |
|
3 | 7 | Il y a 3 years, 7 months | |
|
Getting constantly errors in the editor side as "invalid Json"
Commencé par : sergioC-13 in: Toolset Professional Support |
|
2 | 3 | Il y a 3 years, 7 months | |
|
wpv-reset-password-form shortcode
Commencé par : sergioC-13 in: Toolset Professional Support |
|
2 | 3 | Il y a 3 years, 9 months | |
|
error trying to save changes in the "No items found text" in the views
Commencé par : sergioC-13 in: Toolset Professional Support |
|
2 | 8 | Il y a 3 years, 9 months | |
|
Save user data in a CPT after edit profile using Cred forms
Commencé par : sergioC-13 in: Toolset Professional Support |
|
2 | 3 | Il y a 3 years, 10 months |