{"id":1088522,"date":"2016-03-14T09:54:14","date_gmt":"2016-03-14T16:54:14","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/"},"modified":"2016-03-29T09:35:10","modified_gmt":"2016-03-29T16:35:10","slug":"required-fields-customization","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/","title":{"rendered":"Required Fields Customization"},"content":{"rendered":"<p>I want to simplify required fields for non-logged in users to submit an event.<\/p>\n<p>I&#8217;ve added the code (below) to my functions.php file &#8211; as suggested on the Customize the List of Required Fields page &#8211; https:\/\/theeventscalendar.com\/knowledgebase\/required-fields-for-events-submission-form\/<\/p>\n<p>add_filter( &#8216;tribe_events_community_required_fields&#8217;, &#8216;my_community_required_fields&#8217;, 10, 1 );<\/p>\n<p>function my_community_required_fields( $fields ) {<br \/>\n    $fields = array(<br \/>\n        &#8216;post_title&#8217;,<br \/>\n        &#8216;post_content&#8217;,<br \/>\n    );<\/p>\n<p>    \/\/ Requiring the organizer email (or other &#8220;square bracketed&#8221;<br \/>\n    \/\/ fields) can&#8217;t be done using the above approach, but we can<br \/>\n    \/\/ simply test within the $_POST superglobal directly.<br \/>\n    \/\/<br \/>\n    \/\/ If a field hasn&#8217;t been populated then we simply add a requirement<br \/>\n    \/\/ using a field name we know doesn&#8217;t exist, but can be used to form<br \/>\n    \/\/ a meaningful error message (if the org email is missing the user<br \/>\n    \/\/ will see &#8220;Organizer Email is required&#8221;).<br \/>\n    \/\/<br \/>\n    \/\/ You could take this a step further and additionally validate the<br \/>\n    \/\/ email field to ensure it looks like a valid email address and<br \/>\n    \/\/ provide an alternative error using the same approach.<br \/>\n    if ( empty( $_POST[&#8216;organizer&#8217;][&#8216;Email&#8217;] ) )<br \/>\n        $fields[] = &#8216;Organizer Email&#8217;;<\/p>\n<p>    return $fields;<br \/>\n}<\/p>\n<p>The URL in question is: https:\/\/crownbasketball.com\/events\/community\/add<\/p>\n","protected":false},"template":"","class_list":["post-1088522","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>Required Fields Customization -<\/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\/required-fields-customization\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Required Fields Customization -\" \/>\n<meta property=\"og:description\" content=\"I want to simplify required fields for non-logged in users to submit an event. I&#8217;ve added the code (below) to my functions.php file &#8211; as suggested on the Customize the List of Required Fields page &#8211; https:\/\/theeventscalendar.com\/knowledgebase\/required-fields-for-events-submission-form\/ add_filter( &#8216;tribe_events_community_required_fields&#8217;, &#8216;my_community_required_fields&#8217;, 10, 1 ); function my_community_required_fields( $fields ) { $fields = array( &#8216;post_title&#8217;, &#8216;post_content&#8217;, ); \/\/ [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-29T16:35:10+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\/required-fields-customization\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/\",\"name\":\"Required Fields Customization -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-03-14T16:54:14+00:00\",\"dateModified\":\"2016-03-29T16:35:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/#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\":\"Required Fields Customization\"}]},{\"@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":"Required Fields Customization -","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\/required-fields-customization\/","og_locale":"en_US","og_type":"article","og_title":"Required Fields Customization -","og_description":"I want to simplify required fields for non-logged in users to submit an event. I&#8217;ve added the code (below) to my functions.php file &#8211; as suggested on the Customize the List of Required Fields page &#8211; https:\/\/theeventscalendar.com\/knowledgebase\/required-fields-for-events-submission-form\/ add_filter( &#8216;tribe_events_community_required_fields&#8217;, &#8216;my_community_required_fields&#8217;, 10, 1 ); function my_community_required_fields( $fields ) { $fields = array( &#8216;post_title&#8217;, &#8216;post_content&#8217;, ); \/\/ [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/","article_modified_time":"2016-03-29T16:35:10+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\/required-fields-customization\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/","name":"Required Fields Customization -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-03-14T16:54:14+00:00","dateModified":"2016-03-29T16:35:10+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/required-fields-customization\/#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":"Required Fields Customization"}]},{"@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\/1088522","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\/1088522\/revisions"}],"predecessor-version":[{"id":1088903,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1088522\/revisions\/1088903"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1088522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}