{"id":1136339,"date":"2016-07-06T17:15:51","date_gmt":"2016-07-07T00:15:51","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/"},"modified":"2016-07-06T17:17:34","modified_gmt":"2016-07-07T00:17:34","slug":"i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/","title":{"rendered":"I need to know how do i get an Event Post with Ajax (wp-admin.php)"},"content":{"rendered":"<p>Just before i start to use Event Tickets plus i used this code:<\/p>\n<pre><code>\n\tfunction ct_get_event() {\n\t\t\n\t\t$post_id = $_POST[&#039;post_id&#039;];\n\t\t$query = new WP_Query( &#039;p=&#039;.$post_id );\n\t\t\n\t\tif ( $query-&gt;have_posts() ) :\n\t\t\twhile ( $query-&gt;have_posts() ) : $query-&gt;the_post();\n\t\t\t\tthe_title();\n\t\t\t\tthe_content();\n\t\t\tendwhile;\n\t\telse:\n\t\t\techo &#039;no posts found&#039;;\n\t\tendif;\n\t}\n\tadd_action(&#039;wp_ajax_get_event&#039;, &#039;ct_get_event&#039;);\n\tadd_action(&#039;wp_ajax_nopriv_get_event&#039;, &#039;ct_get_event&#039;);\n<\/code><\/pre>\n<p>But now its obsolete, can u tell me how to do the request with single-event template?<\/p>\n","protected":false},"template":"","class_list":["post-1136339","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>I need to know how do i get an Event Post with Ajax (wp-admin.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\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"I need to know how do i get an Event Post with Ajax (wp-admin.php) -\" \/>\n<meta property=\"og:description\" content=\"Just before i start to use Event Tickets plus i used this code: function ct_get_event() { $post_id = $_POST[&#039;post_id&#039;]; $query = new WP_Query( &#039;p=&#039;.$post_id ); if ( $query-&gt;have_posts() ) : while ( $query-&gt;have_posts() ) : $query-&gt;the_post(); the_title(); the_content(); endwhile; else: echo &#039;no posts found&#039;; endif; } add_action(&#039;wp_ajax_get_event&#039;, &#039;ct_get_event&#039;); add_action(&#039;wp_ajax_nopriv_get_event&#039;, &#039;ct_get_event&#039;); But now its obsolete, can [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-07-07T00:17:34+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/\",\"name\":\"I need to know how do i get an Event Post with Ajax (wp-admin.php) -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-07-07T00:15:51+00:00\",\"dateModified\":\"2016-07-07T00:17:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-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\":\"I need to know how do i get an Event Post with Ajax (wp-admin.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":"I need to know how do i get an Event Post with Ajax (wp-admin.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\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/","og_locale":"en_US","og_type":"article","og_title":"I need to know how do i get an Event Post with Ajax (wp-admin.php) -","og_description":"Just before i start to use Event Tickets plus i used this code: function ct_get_event() { $post_id = $_POST[&#039;post_id&#039;]; $query = new WP_Query( &#039;p=&#039;.$post_id ); if ( $query-&gt;have_posts() ) : while ( $query-&gt;have_posts() ) : $query-&gt;the_post(); the_title(); the_content(); endwhile; else: echo &#039;no posts found&#039;; endif; } add_action(&#039;wp_ajax_get_event&#039;, &#039;ct_get_event&#039;); add_action(&#039;wp_ajax_nopriv_get_event&#039;, &#039;ct_get_event&#039;); But now its obsolete, can [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/","article_modified_time":"2016-07-07T00:17:34+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/","name":"I need to know how do i get an Event Post with Ajax (wp-admin.php) -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-07-07T00:15:51+00:00","dateModified":"2016-07-07T00:17:34+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-php\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/i-need-to-know-how-do-i-get-an-event-post-with-ajax-wp-admin-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":"I need to know how do i get an Event Post with Ajax (wp-admin.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\/1136339","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\/1136339\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1136339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}