Home › Forums › Calendar Products › Community Events › Setting Venue and Organizer sub-fields as required
- This topic has 5 replies, 2 voices, and was last updated 10 years, 5 months ago by
Nico.
-
AuthorPosts
-
October 25, 2015 at 7:06 pm #1017756
Sean
ParticipantHi. We were following your guide for customizing the required fields for Community Events’ Submit an Event form and wanted to make a few Venue and Organizer sub-fields required. These include: Venue Address, Venue City, Venue State, Venue Zip Code, Organizer Email.
However, we noticed in the forums that there might be some existing bugs with setting required fields.
So, with that said:
1) Is the code in your Required fields for events submission form guide still valid? (Looks like it hasn’t been updated since January)
2) Are there any existing bugs that prohibit us from setting any of the standard fields or Venue/Organizer sub-fields as required? If so, are fixes set to be included in the 4.0 release?
2) If there are no existing bugs, can you please confirm which Venue and Organizer sub-fields we can set as required fields?Thank you.
October 26, 2015 at 9:42 am #1017980Nico
MemberHowdy Karly,
Welcome to our support forums and thanks for reaching out to us! Thanks also for searching the forums before posting ๐
As you point out there seems to be some issues with the snippets provided in the article, which I’ll flag for review.
Looks like Brian already helped a customer out on this, Can you tried the code they have put together here: https://theeventscalendar.com/support/forums/topic/make-organizer-email-required/#dl_post-1007511 ?
Please let me know if that works for you as well,
Best,
NicoOctober 26, 2015 at 12:43 pm #1018646Sean
ParticipantHi Nico,
Thank you for bringing that topic to my attention. I tried Brian’s code but am receiving the following error:
Warning: Invalid argument supplied for foreach() in …/functions.php on line 58
I’ve copied Brian’s code for that filter exactly, so I’m not sure why that error is appearing:
add_filter( 'tribe_events_community_required_fields', 'tribe_community_required_fields_org_email', 10, 1 ); function tribe_community_required_fields_org_email( $fields ) { $required_email = $_POST['organizer']['Email']; foreach( $required_email as $email) { if ( empty( $email ) ) $fields[] = 'Organizer Email'; } return $fields; }Please advise.
October 28, 2015 at 4:55 am #1019222Nico
MemberHi Karly,
Thanks for letting me know! I trusted the snippet worked. I’ve made a slight modification and it seems to be working for me know:
add_filter( 'tribe_events_community_required_fields', 'tribe_community_required_fields_org_email', 10, 1 );function tribe_community_required_fields_org_email( $fields ) {
if ( isset( $_POST['organizer']['Email'] ) ) {
$required_email = $_POST['organizer']['Email'];foreach( $required_email as $email) {
if ( empty( $email ) )
$fields[] = 'Organizer Email';
}
}return $fields;
}
Please give it another try and let me know,
Best,
NicoOctober 28, 2015 at 6:58 am #1019256Sean
ParticipantThank you very much Nico. That works for me too!
October 29, 2015 at 8:03 am #1019772Nico
MemberHey Karly,
Thanks for confirming this ๐ Glad to hear this is sorted now!
Iโll go ahead and close out this thread, but if you need help with anything else please donโt hesitate to create a new one and we will be happy to assist you.
Best,
Nico -
AuthorPosts
- The topic ‘Setting Venue and Organizer sub-fields as required’ is closed to new replies.
