Home › Forums › Calendar Products › Community Events › Form code for required fields not working
- This topic has 3 replies, 4 voices, and was last updated 9 years, 7 months ago by
matt.
-
AuthorPosts
-
August 24, 2016 at 5:43 pm #1155600
matt
ParticipantHello,
Since updating to the latest versions of your plugins, the code in my functions.php file don’t seem to be working to make the email and phone fields required under organiser details. I’m not sure what I have done wrong.
Here is the link to the form…http://blueseptember.org.nz/events/community/add/
Kind regards,
MattAugust 25, 2016 at 5:58 am #1155756Nico
MemberHi there Matt,
Thanks for getting in touch! Indeed we introduced a fix in Community Events for the old validation code because it broke at some point, this was reported by other users and developers decided to do this in a different way although the knowledgebase article isn’t reflecting these changes yet (but will be updated soon).
Try using this code instead (be sure to modify it to match your required fields):
/* Tribe make community fields require */
add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );
function my_community_required_fields( $fields ) {
$fields = array(
'post_title',
'post_content',
'venue',
//'organizer',
);return $fields;
}add_filter( 'tribe_events_community_required_venue_fields', 'my_venue_community_required_fields', 10, 1 );
function my_venue_community_required_fields( $fields ) {
$fields = array(
'Venue', //name
//'Address',
//'City',
//'Province',
//'State',
//'Zip',
'Phone',
//'URL',
);return $fields;
}add_filter( 'tribe_events_community_required_organizer_fields', 'my_organizer_community_required_fields', 10, 1 );
function my_organizer_community_required_fields( $fields ) {
$fields = array(
'Organizer', //name
'Phone',
'Website',
'Email',
);return $fields;
}
Please try this code instead and let me know if it makes thing right,
Best,
NicoSeptember 16, 2016 at 9:35 am #1165201Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Form code for required fields not working’ is closed to new replies.
