{"id":1126127,"date":"2016-06-13T08:23:42","date_gmt":"2016-06-13T15:23:42","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/"},"modified":"2016-06-13T08:23:42","modified_gmt":"2016-06-13T15:23:42","slug":"find-post_id-to-add-post_excerpt-on-tickets-email-email-php","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/","title":{"rendered":"Find $post_id to add post_excerpt on Tickets email (email.php)"},"content":{"rendered":"<p>Hello,<\/p>\n<p>My client is asking for more information to be displayed about the event on the actual ticket. This comes in particularly useful when using Event Tickets Plus on a custom post type, not an actual event. (In this case, registration for a kid&#8217;s swimming program).<\/p>\n<p>I&#8217;ve found some older posts that reference this code:<\/p>\n<pre><code>$ticket_product_id = get_post_meta( $ticket[&#039;ticket_id&#039;], &#039;_tribe_wooticket_product&#039;, true );\n$ticket_product = get_post( $ticket_product_id );\n$ticket_description = $ticket_product-&gt;post_excerpt;<\/code><\/pre>\n<blockquote class=\"wp-embedded-content\" data-secret=\"VbGyBXdW7d\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-important-ticket-information-to-emailed-ticket\/\">Add important ticket information to emailed ticket?<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Add important ticket information to emailed ticket?&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-important-ticket-information-to-emailed-ticket\/embed\/#?secret=xIGH3F7yN3#?secret=VbGyBXdW7d\" data-secret=\"VbGyBXdW7d\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"Qd836NLHcA\"><p><a href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-ticket-description-to-email-php\/\">add ticket description to email.php<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;add ticket description to email.php&#8221; &#8212; \" src=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-ticket-description-to-email-php\/embed\/#?secret=E4W8f37y6M#?secret=Qd836NLHcA\" data-secret=\"Qd836NLHcA\" width=\"580\" height=\"327\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>But it doesn&#8217;t work when placed in my email.php (and echo&#8217;d out), and appears to reference an earlier version of your software anyway. <\/p>\n<p><strong>Question 1:<\/strong> Can you confirm that this code <strong>won&#8217;t<\/strong> do what I want it to do?<\/p>\n<p>So, to display this extra information, I&#8217;m thinking the easiest way would be to display either the post&#8217;s excerpt \u2014 or even its full content, if needed \u2014 on the ticket email. <\/p>\n<p>To do so, I think I have to determine the $post_id of the post that uses the ticket, and then pull the post_excerpt from there. Using something like this:<\/p>\n<p><code>$text = apply_filters(&#039;the_excerpt&#039;, get_post_field(&#039;post_excerpt&#039;, $post_id));<\/code><\/p>\n<p><strong>Question 2:<\/strong> How can I determine the $post_id that the ticket is attached to?<\/p>\n<p>Thank you!<\/p>\n","protected":false},"template":"","class_list":["post-1126127","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>Find $post_id to add post_excerpt on Tickets email (email.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\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Find $post_id to add post_excerpt on Tickets email (email.php) -\" \/>\n<meta property=\"og:description\" content=\"Hello, My client is asking for more information to be displayed about the event on the actual ticket. This comes in particularly useful when using Event Tickets Plus on a custom post type, not an actual event. (In this case, registration for a kid&#8217;s swimming program). I&#8217;ve found some older posts that reference this code: [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-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=\"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\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/\",\"name\":\"Find $post_id to add post_excerpt on Tickets email (email.php) -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-06-13T15:23:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-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\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Tickets Plus\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Find $post_id to add post_excerpt on Tickets email (email.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":"Find $post_id to add post_excerpt on Tickets email (email.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\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/","og_locale":"en_US","og_type":"article","og_title":"Find $post_id to add post_excerpt on Tickets email (email.php) -","og_description":"Hello, My client is asking for more information to be displayed about the event on the actual ticket. This comes in particularly useful when using Event Tickets Plus on a custom post type, not an actual event. (In this case, registration for a kid&#8217;s swimming program). I&#8217;ve found some older posts that reference this code: [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/","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\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/","name":"Find $post_id to add post_excerpt on Tickets email (email.php) -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-06-13T15:23:42+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/find-post_id-to-add-post_excerpt-on-tickets-email-email-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":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Event Tickets Plus","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/"},{"@type":"ListItem","position":5,"name":"Find $post_id to add post_excerpt on Tickets email (email.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\/1126127","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\/1126127\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1126127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}