Problem: I am trying to validate a custom field with cred_form_validate, but I cannot validate a specific field. Errors never appear in the form.
Solution: Be sure to include the form_messages field in the Form builder so errors can be displayed. Then use the following syntax to validate a custom field:
function fn_cred_form_validate($error_fields, $form_data)
{
list($fields,$errors)=$error_fields;
if ($form_data['id']==221) {
if (empty($fields['wpcf-application-tour-number']['value'])) {
//set error message for my_field
$errors['application-tour-number']='Please select tour first';
}
}
return array($fields,$errors);
}
add_filter('cred_form_validate','fn_cred_form_validate',10,2);
Notice that the wpcf- prefix is required in the $fields array, but should not be included in the $errors array.
Problem:
The user would like to use different view's items count per screen. For example, display 9 posts in Desktop and only 3 posts in mobile.
Solution:
Currently, there is no option or setting to change the number of posts per view depending on the screen/device. You can only do it using two views. Put each one inside a container block, and make them show or hide depending the screen.
There is also a hook you can use to programmatically change the settings of a view. The wpv_view_settings hook. Check the example code on it.
Problem:
The user would like to add captions to a Toolset gallery images.
Solution:
Toolset gallery block pulls the captions of the images from the WordPress Media Library. The caption needs to be added there, not inside the block.