{"id":71769,"date":"2013-10-20T03:36:36","date_gmt":"2013-10-20T10:36:36","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/"},"modified":"2015-07-07T06:30:31","modified_gmt":"2015-07-07T13:30:31","slug":"tribe_create_venue-doesnt-set-venue-title","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/","title":{"rendered":"tribe_create_venue() doesn&#039;t set venue title"},"content":{"rendered":"<p>Hi there!<\/p>\n<p>I&#8217;m working on a php script to import data into Events Calendar Pro, but got stuck with two problems:<\/p>\n<p>1. For creating an venue I use this code<br \/>\n(as described here: http:\/\/docs.tri.be\/Events-Calendar\/function-tribe_create_venue.html):<\/p>\n<p>$venue = array();<br \/>\n$venue[&#8220;Venue&#8221;] = $location;<br \/>\n\/\/ $venue[&#8220;post_title&#8221;] = $location; \/\/ Doesn&#8217;t work neither<br \/>\n$venue[&#8220;post_type&#8221;] = &#8220;tribe_venue&#8221;;<br \/>\n$event[&#8220;post_status&#8221;] = &#8220;pending&#8221;;<br \/>\n$venue[&#8220;EventCountry&#8221;] = $country; \/\/ $venue[&#8220;Country&#8221;] doesn&#8217;t work! Looks like the documentation above is outdated!<br \/>\n$venue[&#8220;Address&#8221;] = $street;<br \/>\n$venue[&#8220;City&#8221;] = $city;<br \/>\n$venue[&#8220;Zip&#8221;] = $zip;<br \/>\n$venue[&#8220;ShowMap&#8221;] = true;<br \/>\n$venue[&#8220;ShowMapLink&#8221;] = true;<br \/>\n$venue[&#8220;URL&#8221;] = $url;<br \/>\n$VenueID = tribe_create_venue($venue);<\/p>\n<p>The venue is created, but the title (post_title) is set to &#8220;Unnamed Venue&#8221;.<br \/>\nI also tried to add this, but the title still stays the same:<\/p>\n<p>if ($VenueID != false)<br \/>\n{<br \/>\n$my_post = array(<br \/>\n&#8216;ID&#8217; =&gt; $VenueID,<br \/>\n&#8216;post_title&#8217; =&gt; &#8216;Another title.&#8217;<br \/>\n);<br \/>\nwp_update_post( $my_post );<\/p>\n<p>If I use &#8216;post_content&#8217; =&gt; &#8216;Another content.&#8217; it works, which is very irritating!<\/p>\n<p>2. For creating the event (which should link to the venue) I use this code<br \/>\n(as described here: http:\/\/docs.tri.be\/Events-Calendar\/function-tribe_create_event.html):<\/p>\n<p>$event = array();<br \/>\n$event[&#8220;post_title&#8221;] = $title; \/\/ Here post_title works! \ud83d\ude42<br \/>\n$event[&#8220;post_status&#8221;] = &#8220;pending&#8221;;<br \/>\n$event[&#8220;post_type&#8221;] = &#8220;tribe_events&#8221;;<br \/>\n$event[&#8220;post_content&#8221;] = $description;<br \/>\n$event[&#8220;EventStartDate&#8221;] = $start_date;<br \/>\n$event[&#8220;Venue&#8221;] = $VenueID;<br \/>\n$post_id = tribe_create_event($event);<\/p>\n<p>Unfortunately the venue is not linked to the event.<br \/>\nFor both problems I tried a lot of workarounds and research, but didn&#8217;t find any working solution.<br \/>\nDo you have an idea?<\/p>\n<p>Best regards,<br \/>\nOliver<\/p>\n","protected":false},"template":"","class_list":["post-71769","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>tribe_create_venue() doesn&#039;t set venue title -<\/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\/tribe_create_venue-doesnt-set-venue-title\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"tribe_create_venue() doesn&#039;t set venue title -\" \/>\n<meta property=\"og:description\" content=\"Hi there! I&#8217;m working on a php script to import data into Events Calendar Pro, but got stuck with two problems: 1. For creating an venue I use this code (as described here: http:\/\/docs.tri.be\/Events-Calendar\/function-tribe_create_venue.html): $venue = array(); $venue[&#8220;Venue&#8221;] = $location; \/\/ $venue[&#8220;post_title&#8221;] = $location; \/\/ Doesn&#8217;t work neither $venue[&#8220;post_type&#8221;] = &#8220;tribe_venue&#8221;; $event[&#8220;post_status&#8221;] = &#8220;pending&#8221;; $venue[&#8220;EventCountry&#8221;] [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-07-07T13:30:31+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\/tribe_create_venue-doesnt-set-venue-title\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/\",\"name\":\"tribe_create_venue() doesn&#039;t set venue title -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2013-10-20T10:36:36+00:00\",\"dateModified\":\"2015-07-07T13:30:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/#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\":\"tribe_create_venue() doesn&#039;t set venue title\"}]},{\"@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":"tribe_create_venue() doesn&#039;t set venue title -","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\/tribe_create_venue-doesnt-set-venue-title\/","og_locale":"en_US","og_type":"article","og_title":"tribe_create_venue() doesn&#039;t set venue title -","og_description":"Hi there! I&#8217;m working on a php script to import data into Events Calendar Pro, but got stuck with two problems: 1. For creating an venue I use this code (as described here: http:\/\/docs.tri.be\/Events-Calendar\/function-tribe_create_venue.html): $venue = array(); $venue[&#8220;Venue&#8221;] = $location; \/\/ $venue[&#8220;post_title&#8221;] = $location; \/\/ Doesn&#8217;t work neither $venue[&#8220;post_type&#8221;] = &#8220;tribe_venue&#8221;; $event[&#8220;post_status&#8221;] = &#8220;pending&#8221;; $venue[&#8220;EventCountry&#8221;] [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/","article_modified_time":"2015-07-07T13:30:31+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\/tribe_create_venue-doesnt-set-venue-title\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/","name":"tribe_create_venue() doesn&#039;t set venue title -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2013-10-20T10:36:36+00:00","dateModified":"2015-07-07T13:30:31+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/tribe_create_venue-doesnt-set-venue-title\/#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":"tribe_create_venue() doesn&#039;t set venue title"}]},{"@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\/71769","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\/71769\/revisions"}],"predecessor-version":[{"id":982963,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/71769\/revisions\/982963"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=71769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}