{"id":1020448,"date":"2015-10-30T17:07:21","date_gmt":"2015-10-31T00:07:21","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/"},"modified":"2015-11-03T23:39:58","modified_gmt":"2015-11-04T07:39:58","slug":"follow-up-to-required-fields-error-messages","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/","title":{"rendered":"Follow up to Required Fields Error Messages"},"content":{"rendered":"<p>Following up to <a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-error-messages\/\">this topic<\/a>. After further testing, I found that when submitting an event, if the user selects a Saved Venue or Saved Organizer, the &#8220;square bracketed&#8221; fields are not recognized as having data (even though the saved venue\/organizer does have data in those fields). Thus, the user is unable to submit the event. Advice?<\/p>\n<p>Here&#8217;s the code we&#8217;re using in our functions file:<\/p>\n<pre><code>    \/\/ TEC: Customize the List of Required Fields on\n\t\/\/ the Community Events Submit an Event Form\nadd_filter( &#039;tribe_events_community_required_fields&#039;, &#039;my_community_required_fields&#039;, 10, 1 );\n \nfunction my_community_required_fields( $fields ) {\n    $fields = array(\n                &#039;post_title&#039;,\n\t\t&#039;EventStartDate&#039;,\n\t\t&#039;EventStartHour&#039;,\n\t\t&#039;EventStartMinute&#039;,\n\t\t&#039;EventStartMeridian&#039;,\n\t\t&#039;tax_input&#039;,\n\t\t&#039;EventURL&#039;,\n                &#039;organizer&#039;,\n\t\t&#039;venue&#039;,\n\t\t&#039;_ecp_custom_2&#039;,\n    );\n\t\n    return $fields;\n   \n} \n    \/\/ Require the organizer email (or other &quot;square bracketed&quot;\n    \/\/ fields) by testing within the $_POST superglobal directly.\nadd_filter( &#039;tribe_events_community_required_fields&#039;, &#039;tribe_community_required_fields_org_email&#039;, 10, 1 ); \n  \nfunction tribe_community_required_fields_org_email( $fields ) {\n     \n    if ( isset( $_POST[&#039;organizer&#039;][&#039;Email&#039;] ) ) {\n        $required_email = $_POST[&#039;organizer&#039;][&#039;Email&#039;];\n           \n        foreach( $required_email as $email) {\n            if ( empty( $email ) )\n                $fields[] = &#039;Organizer Email&#039;;\n        }\n    }\n \n    return $fields;\n}\n  \nadd_filter( &#039;tribe_events_community_required_fields&#039;, &#039;tribe_community_required_fields_venue_city&#039;, 10, 1 ); \n  \nfunction tribe_community_required_fields_venue_city( $fields ) {\n       \n    if ( empty( $_POST[&#039;venue&#039;][&#039;Address&#039;] ) )\n        $fields[] = &#039;Venue Address&#039;;\n\t\n    if ( empty( $_POST[&#039;venue&#039;][&#039;City&#039;] ) )\n        $fields[] = &#039;Venue City&#039;;\n\t\n    if ( empty( $_POST[&#039;venue&#039;][&#039;State&#039;] ) )\n        $fields[] = &#039;Venue State&#039;;\n\n    if ( empty( $_POST[&#039;venue&#039;][&#039;Zip&#039;] ) )\n        $fields[] = &#039;Venue Zip Code&#039;;\n     \n    return $fields;\n}\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1020448","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Follow up to Required Fields Error Messages -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Follow up to Required Fields Error Messages -\" \/>\n<meta property=\"og:description\" content=\"Following up to this topic. After further testing, I found that when submitting an event, if the user selects a Saved Venue or Saved Organizer, the &#8220;square bracketed&#8221; fields are not recognized as having data (even though the saved venue\/organizer does have data in those fields). Thus, the user is unable to submit the event. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-11-04T07:39:58+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/\",\"name\":\"Follow up to Required Fields Error Messages -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-10-31T00:07:21+00:00\",\"dateModified\":\"2015-11-04T07:39:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Community Events\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Follow up to Required Fields Error Messages\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Follow up to Required Fields Error Messages -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/","og_locale":"en_US","og_type":"article","og_title":"Follow up to Required Fields Error Messages -","og_description":"Following up to this topic. After further testing, I found that when submitting an event, if the user selects a Saved Venue or Saved Organizer, the &#8220;square bracketed&#8221; fields are not recognized as having data (even though the saved venue\/organizer does have data in those fields). Thus, the user is unable to submit the event. [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/","article_modified_time":"2015-11-04T07:39:58+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/","name":"Follow up to Required Fields Error Messages -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-10-31T00:07:21+00:00","dateModified":"2015-11-04T07:39:58+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/follow-up-to-required-fields-error-messages\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Community Events","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/community-events\/"},{"@type":"ListItem","position":5,"name":"Follow up to Required Fields Error Messages"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1020448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1020448\/revisions"}],"predecessor-version":[{"id":1020451,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1020448\/revisions\/1020451"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1020448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}