Required Custom Fields
-
Hello,
I’m receiving an error when submitting an event form stating the following:
‘Ecp Custom 30 is required’
I have located the issue and it’s being caused by this custom code:
add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );
function my_community_required_fields( $fields ) {
if ( ! is_array( $fields ) ) {
return $fields;
}
$fields[] = 'EventStartDate';
$fields[] = 'EventEndDate';
$fields[] = 'tax_input.tribe_events_cat';
$fields[] = 'venue';
$fields[] = 'organizer';
/*
$fields[] = '_ecp_custom_25';
$fields[] = '_ecp_custom_30';
$fields[] = '_ecp_custom_31';
$fields[] = '_ecp_custom_32';
$fields[] = '_ecp_custom_33';
*/
return $fields;
}(Custom fields have been commented out for now to ensure the form works)
Even when I fill in all fields I still get the errors for custom fields not being populated.
Could you let me know if there is an issue with this code and how I can make the custom fields required if this is not the correct method?
Thanks, Greg.
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Required Custom Fields’ is closed to new replies.