CRED plugin provides an API, making it easy to customize your post or user forms. The API includes hooks (actions and filters) to accomplish specific tasks using PHP code.
When you ask for help or report issues, make sure to tell us all related information about your form and what you want to achieve.
Viewing 15 topics - 646 through 660 (of 692 total)
Problem: I have a Form that creates new posts. I would like to automatically add a specific term to the new post using the Forms API, but the update_post_meta function isn't working as expected.
Solution: Try the wp_set_object_terms function with the Forms API cred_save_data:
Problem: I would like to add some custom validation to a Form with two custom date fields. I would like to validate it such that the start date is before the end date. How can I access the date value in the $error_fields parameter?
Solution: Use the following syntax to access the Unix timestamp for a datepicker field:
add_filter('cred_form_validate','start_end_date',10,2);
function start_end_date($error_fields, $form_data)
{
//field data are field values and errors
list($fields,$errors)=$error_fields;
...
$fields['wpcf-date-start']['value']['datepicker']