{"id":1218852,"date":"2017-01-15T19:19:39","date_gmt":"2017-01-16T03:19:39","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/"},"modified":"2017-01-15T19:19:39","modified_gmt":"2017-01-16T03:19:39","slug":"getting-names-of-rsvp-tickets-using-php","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/","title":{"rendered":"Getting names of RSVP tickets using PHP"},"content":{"rendered":"<p>I have a small amount of custom code shown below. It all works, but I now need to know which RSVP tickets exist for each event. I&#8217;m assuming this is in the metadata, but don&#8217;t know how to access it.<br \/>\nI thought maybe: tribe_events_template_data, tribe_get_event_meta or tribe_get_ticket_form, but don&#8217;t know how to use these functions. There has to be a simple way to get them. Normally this information wouldn&#8217;t be helpful to people, but I want to group events by what tickets they have so need to know the names of the tickets for each event. Can I do that? I have Events Calendar Pro which might give me more functionality if that&#8217;s an issue.<\/p>\n<pre><code>&lt;?php\n    global $post;\t\/\/ Ensure the global $post variable is in scope\n    $basicSeminarsArray = array();\n   $events = tribe_get_events( array(\n\t\t&#039;start_date&#039;     =&gt; date( &#039;2017-01-01 12:00:00&#039; ),\n\t\t&#039;end_date&#039;       =&gt; date( &#039;2026-12-31 12:00:00&#039; ),\n\t\t&#039;eventDisplay&#039;   =&gt; &#039;custom&#039;,\n\t\t&#039;posts_per_page&#039; =&gt; -1\n\t));\n\t$todaysDate = date(&quot;Y-m-d H:i:s&quot;);\n    if ( empty( $events ) ) {\n\t\t\/\/do something...\n\t}\n\t\/\/ Or we may have some to show\n\telse foreach( $events as $post ) {\n\t\/\/\tsetup_postdata( $post );\n\t\t$eventDate = tribe_get_end_date(null,true,&quot;Y-m-d H:i:s&quot;);\n\t\t$state = tribe_get_state();\n\t\tif(empty($state)) {\n\t\t\t$locationStringJeff = tribe_get_city().&#039;, &#039;.tribe_get_country();\n\t\t} else {\n\t\t\tif (tribe_get_country()==&#039;United States&#039;) {\n\t\t\t\t$locationStringJeff = tribe_get_city().&#039;, &#039;.tribe_get_state().&#039;, USA&#039;;\n\t\t\t} else {\n\t\t\t\t$locationStringJeff = tribe_get_city().&#039;, &#039;.tribe_get_state().&#039;, &#039;.tribe_get_country();\n\t\t\t}\n\t\t}\n\t\tif(strpos(get_the_title(), &quot;Convention&quot;)) {\n\t\t    $wordConventionWasFound = true;\n\t\t} else {\n\t\t    $wordConventionWasFound = false;\n\t\t}\n\t\t$position = strpos(get_the_title(), &quot;&#8211;&quot;);\n\t\t$title_text = substr(get_the_title(), 0, $position);\n\t\t$major_city_text = substr(get_the_title(), $position);  \/\/Ali wants to show the major city like Chicago so since this is already in the title why not...\n\t\t\n\t\tif (($eventDate &gt;= $todaysDate) &amp;&amp; (tribe_events_has_tickets()) &amp;&amp; !$wordConventionWasFound) {\n\t        $fullEventLayout = tribe_get_start_date(null,false,&#039;M j&#039;).&#039;-&#039;.tribe_get_end_date(null,false, &#039;j, Y&#039;).&#039; &#039;.$major_city_text;\n\t\t    array_push($basicSeminarsArray, $fullEventLayout);\n        }\n\t}\n?&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1218852","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>Getting names of RSVP tickets using PHP -<\/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\/getting-names-of-rsvp-tickets-using-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting names of RSVP tickets using PHP -\" \/>\n<meta property=\"og:description\" content=\"I have a small amount of custom code shown below. It all works, but I now need to know which RSVP tickets exist for each event. I&#8217;m assuming this is in the metadata, but don&#8217;t know how to access it. I thought maybe: tribe_events_template_data, tribe_get_event_meta or tribe_get_ticket_form, but don&#8217;t know how to use these functions. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/\" \/>\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\/getting-names-of-rsvp-tickets-using-php\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/\",\"name\":\"Getting names of RSVP tickets using PHP -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-01-16T03:19:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/#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\":\"Getting names of RSVP tickets using PHP\"}]},{\"@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":"Getting names of RSVP tickets using PHP -","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\/getting-names-of-rsvp-tickets-using-php\/","og_locale":"en_US","og_type":"article","og_title":"Getting names of RSVP tickets using PHP -","og_description":"I have a small amount of custom code shown below. It all works, but I now need to know which RSVP tickets exist for each event. I&#8217;m assuming this is in the metadata, but don&#8217;t know how to access it. I thought maybe: tribe_events_template_data, tribe_get_event_meta or tribe_get_ticket_form, but don&#8217;t know how to use these functions. [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/","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\/getting-names-of-rsvp-tickets-using-php\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/","name":"Getting names of RSVP tickets using PHP -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-01-16T03:19:39+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/getting-names-of-rsvp-tickets-using-php\/#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":"Getting names of RSVP tickets using PHP"}]},{"@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\/1218852","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\/1218852\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1218852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}