{"id":1152025,"date":"2016-08-16T06:50:42","date_gmt":"2016-08-16T13:50:42","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/"},"modified":"2016-08-16T06:50:42","modified_gmt":"2016-08-16T13:50:42","slug":"can-i-use-additional-fields-with-tribe-create-event-function","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/","title":{"rendered":"Can I use Additional Fields with Tribe Create Event function"},"content":{"rendered":"<p>I&#8217;ve defined two Additional Fields:  Branch and BookaRoom_ID.  I would like to use these fields with the tribe_create_event function.  When I view the wp_postmeta table, I see what should be these two fields, but the meta_key values are: _ecp_custom_2 and _ecp_custom_4 (I would have thought that the values would be the Additional Field label names that I defined).<br \/>\nAnyway, I am now trying to load values to these two fields using tribe_create_event and the meta_input tag (I am running wordpress 4.5.3).  The meta_values are not appearing in the wp_postmeta table and I am not able to see them when I use the Filter Bar with those two Additional Fields.<br \/>\nCode Example:<\/p>\n<p>#Add Tribe Event<br \/>\n\t\t$startTime = date(&#8216;Y-m-d H:i:s&#8217;, $val[&#8216;start&#8217;] );<br \/>\n\t\t$ev_startDate = date(&#8216;Y-m-d&#8217;, $val[&#8216;start&#8217;]);<br \/>\n\t\t$ev_startHour = date(&#8216;H&#8217;, $val[&#8216;start&#8217;]);<br \/>\n\t\t$ev_startMinute = date(&#8216;i&#8217;, $val[&#8216;start&#8217;]);<br \/>\n\t\t$endTime = date(&#8216;Y-m-d H:i:s&#8217;, $val[&#8216;end&#8217;] );<br \/>\n\t\t$ev_endDate = date(&#8216;Y-m-d&#8217;, $val[&#8216;end&#8217;]);<br \/>\n\t\t$ev_endHour = date(&#8216;H&#8217;, $val[&#8216;end&#8217;]);<br \/>\n\t\t$ev_endMinute = date(&#8216;i&#8217;, $val[&#8216;end&#8217;]);<\/p>\n<p>\t\tglobal $user_ID;<br \/>\n\t\t$new_post = array(<br \/>\n\t\t&#8216;post_title&#8217; =&gt; $_SESSION[&#8216;bookaroom_meetings_externalVals&#8217;][&#8216;eventTitle&#8217;],<br \/>\n\t\t&#8216;EventStartDate&#8217; =&gt; $ev_startDate,<br \/>\n        &#8216;EventStartHour&#8217; =&gt; $ev_startHour,<br \/>\n        &#8216;EventStartMinute&#8217; =&gt; $ev_startMinute,<br \/>\n\t\t&#8216;EventEndDate&#8217; =&gt; $ev_endDate,<br \/>\n\t\t&#8216;EventEndHour&#8217; =&gt; $ev_endHour,<br \/>\n        &#8216;EventEndMinute&#8217; =&gt; $ev_endMinute,<br \/>\n\t\t&#8216;post_content&#8217; =&gt; $_SESSION[&#8216;bookaroom_meetings_externalVals&#8217;][&#8216;eventDesc&#8217;],<br \/>\n\t\t&#8216;post_status&#8217; =&gt; &#8216;publish&#8217;,<br \/>\n\t\t&#8216;post_author&#8217; =&gt; $user_ID,<br \/>\n\t\t&#8216;post_category&#8217; =&gt; array(0),<br \/>\n\t\t&#8216;meta_input&#8217; =&gt; array (<br \/>\n\t\t    &#8216;_ecp_custom_4&#8217; =&gt; $insertID,<br \/>\n\t\t\t&#8216;BookaRoom_ID&#8217; =&gt; $insertID,<br \/>\n\t\t),<br \/>\n\t\t);<br \/>\n\t\t$post_id = tribe_create_event($new_post);\t\t<\/p>\n<p>\t\t###<br \/>\nWhen I do this, I can add the value with the meta_key value of BookaRoom_ID but not with the value of _ecp_custom_4.  This means that the additional field(s) don&#8217;t show in the event view or as a filter value in the filter bar.<\/p>\n<p>Thanks,<br \/>\nGregory<\/p>\n","protected":false},"template":"","class_list":["post-1152025","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>Can I use Additional Fields with Tribe Create Event function -<\/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\/can-i-use-additional-fields-with-tribe-create-event-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Can I use Additional Fields with Tribe Create Event function -\" \/>\n<meta property=\"og:description\" content=\"I&#8217;ve defined two Additional Fields: Branch and BookaRoom_ID. I would like to use these fields with the tribe_create_event function. When I view the wp_postmeta table, I see what should be these two fields, but the meta_key values are: _ecp_custom_2 and _ecp_custom_4 (I would have thought that the values would be the Additional Field label names [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/\",\"name\":\"Can I use Additional Fields with Tribe Create Event function -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-08-16T13:50:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/#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\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Can I use Additional Fields with Tribe Create Event function\"}]},{\"@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":"Can I use Additional Fields with Tribe Create Event function -","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\/can-i-use-additional-fields-with-tribe-create-event-function\/","og_locale":"en_US","og_type":"article","og_title":"Can I use Additional Fields with Tribe Create Event function -","og_description":"I&#8217;ve defined two Additional Fields: Branch and BookaRoom_ID. I would like to use these fields with the tribe_create_event function. When I view the wp_postmeta table, I see what should be these two fields, but the meta_key values are: _ecp_custom_2 and _ecp_custom_4 (I would have thought that the values would be the Additional Field label names [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/","name":"Can I use Additional Fields with Tribe Create Event function -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-08-16T13:50:42+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/can-i-use-additional-fields-with-tribe-create-event-function\/#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":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Can I use Additional Fields with Tribe Create Event function"}]},{"@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\/1152025","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1152025\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1152025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}