{"id":1029834,"date":"2015-11-23T14:14:08","date_gmt":"2015-11-23T22:14:08","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/"},"modified":"2015-11-24T17:36:36","modified_gmt":"2015-11-25T01:36:36","slug":"warning-when-organizer-email-required-snippet-is-used","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/","title":{"rendered":"Warning when Organizer Email Required snippet is used"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I would like to make the organizer email required on our Community Events submission form.<br \/>\nI have pasted Brian&#8217;s snippet into our child theme functions.php file, as per this thread: https:\/\/theeventscalendar.com\/support\/forums\/topic\/make-organizer-email-required\/#dl_post-1007511<\/p>\n<p>Here&#8217;s what I&#8217;m using:<\/p>\n<p>add_filter( &#8216;tribe_events_community_required_fields&#8217;, &#8216;tribe_community_required_fields_org_email&#8217;, 10, 1 );<br \/>\nfunction tribe_community_required_fields_org_email( $fields ) {<\/p>\n<p>    $required_email = $_POST[&#8216;organizer&#8217;][&#8216;Email&#8217;];<\/p>\n<p>    foreach( $required_email as $email) {<br \/>\n        if ( empty( $email ) )<br \/>\n            $fields[] = &#8216;Organizer Email&#8217;;<br \/>\n    }<\/p>\n<p>    return $fields;<br \/>\n}<\/p>\n<p>There is now a message on the page that says Warning: Invalid argument supplied for foreach()<br \/>\nWe are using the Enfold theme. I&#8217;ve posted the page link in private data. <\/p>\n<p>When I activate Twenty Fifteen or Twenty Fourteen themes, the warning message doesn&#8217;t appear, and they also don&#8217;t prompt for an organizer email if the field is left empty when submitting an event.<\/p>\n<p>The Enfold Theme however shows the warning. When an event is submitted without an organizer email, it shows an error message for the missing email field, plus adds an additional organizer section below the original one, showing two organizer sections instead of one.<\/p>\n<p>Maybe I&#8217;ve included the code incorrectly. Please let me know. Thanks<\/p>\n","protected":false},"template":"","class_list":["post-1029834","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>Warning when Organizer Email Required snippet is used -<\/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\/warning-when-organizer-email-required-snippet-is-used\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Warning when Organizer Email Required snippet is used -\" \/>\n<meta property=\"og:description\" content=\"Hello, I would like to make the organizer email required on our Community Events submission form. I have pasted Brian&#8217;s snippet into our child theme functions.php file, as per this thread: https:\/\/theeventscalendar.com\/support\/forums\/topic\/make-organizer-email-required\/#dl_post-1007511 Here&#8217;s what I&#8217;m using: add_filter( &#8216;tribe_events_community_required_fields&#8217;, &#8216;tribe_community_required_fields_org_email&#8217;, 10, 1 ); function tribe_community_required_fields_org_email( $fields ) { $required_email = $_POST[&#8216;organizer&#8217;][&#8216;Email&#8217;]; foreach( $required_email as $email) { [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-11-25T01:36:36+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\/warning-when-organizer-email-required-snippet-is-used\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/\",\"name\":\"Warning when Organizer Email Required snippet is used -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-11-23T22:14:08+00:00\",\"dateModified\":\"2015-11-25T01:36:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/#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\":\"Warning when Organizer Email Required snippet is used\"}]},{\"@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":"Warning when Organizer Email Required snippet is used -","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\/warning-when-organizer-email-required-snippet-is-used\/","og_locale":"en_US","og_type":"article","og_title":"Warning when Organizer Email Required snippet is used -","og_description":"Hello, I would like to make the organizer email required on our Community Events submission form. I have pasted Brian&#8217;s snippet into our child theme functions.php file, as per this thread: https:\/\/theeventscalendar.com\/support\/forums\/topic\/make-organizer-email-required\/#dl_post-1007511 Here&#8217;s what I&#8217;m using: add_filter( &#8216;tribe_events_community_required_fields&#8217;, &#8216;tribe_community_required_fields_org_email&#8217;, 10, 1 ); function tribe_community_required_fields_org_email( $fields ) { $required_email = $_POST[&#8216;organizer&#8217;][&#8216;Email&#8217;]; foreach( $required_email as $email) { [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/","article_modified_time":"2015-11-25T01:36:36+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\/warning-when-organizer-email-required-snippet-is-used\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/","name":"Warning when Organizer Email Required snippet is used -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-11-23T22:14:08+00:00","dateModified":"2015-11-25T01:36:36+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/warning-when-organizer-email-required-snippet-is-used\/#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":"Warning when Organizer Email Required snippet is used"}]},{"@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\/1029834","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\/1029834\/revisions"}],"predecessor-version":[{"id":1029896,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1029834\/revisions\/1029896"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1029834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}