{"id":1145894,"date":"2016-07-30T23:37:50","date_gmt":"2016-07-31T06:37:50","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/"},"modified":"2016-07-30T23:37:50","modified_gmt":"2016-07-31T06:37:50","slug":"moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/","title":{"rendered":"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action"},"content":{"rendered":"<p>Hi,<\/p>\n<p>We are using the event tickets plus in a custom post type wince we don&#8217;t need much in the way of calendar functionality. Our post type has a custom layout with our custom meta, some of which exists outside the main content area. So we are looking to move the tickets purchase form outside the main content area.<\/p>\n<p>We used the function provided in your themer&#8217;s guide to move the ticket form and were able to modify it to use one of genesis hooks to add the form after the entry content with the proper priority ( I assume I have done this correctly but I will provide my sample ). Thats working great, but this still leaves the original purchase form at the bottom of the post content. I am wondering how to properly remove the tribe_etp_move_tickets_purchase_form function so that it shows up only in the new location.<\/p>\n<pre><code>\n\/*\n * Moves the front-end ticket purchase form, accepts WP action\/hook and optional hook priority\n *\n * @param $ticket_location_action WP Action\/hook to display the ticket form at\n * @param $ticket_location_priority Priority for the WP Action\n *\/\nfunction tribe_etp_move_tickets_purchase_form ( $ticket_location_action, $ticket_location_priority = 10 ) {\n    if ( ! class_exists( &#039;Tribe__Tickets__Tickets&#039;) ) return;\n    $etp_classes = array(\n        &#039;Easy_Digital_Downloads&#039; =&gt;     &#039;Tribe__Tickets_Plus__Commerce__EDD__Main&#039;,\n        &#039;ShoppVersion&#039; =&gt;               &#039;Tribe__Tickets_Plus__Commerce__Shopp__Main&#039;,\n        &#039;WP_eCommerce&#039; =&gt;               &#039;Tribe__Tickets_Plus__Commerce__WPEC__Main&#039;,\n        &#039;Woocommerce&#039; =&gt;                &#039;Tribe__Tickets_Plus__Commerce__WooCommerce__Main&#039;,\n        &#039;Tribe__Tickets__Tickets&#039; =&gt;    &#039;Tribe__Tickets__RSVP&#039;,\n    );\n    foreach ( $etp_classes as  $ecommerce_class =&gt; $ticket_class) {\n        if ( ! class_exists( $ecommerce_class ) || ! class_exists( $ticket_class ) ) continue;\n        $form_display_function = array( $ticket_class::get_instance(), &#039;front_end_tickets_form&#039; );\n        if ( has_action ( &#039;tribe_events_single_event_after_the_meta&#039;, $form_display_function ) ) {\n            remove_action( &#039;tribe_events_single_event_after_the_meta&#039;, $form_display_function, 5 );\n            add_action( $ticket_location_action, $form_display_function, $ticket_location_priority );\n        }\n    }\n}\n\n\/\/ Customize Ticket Form Output for Genesis After Content\ntribe_etp_move_tickets_purchase_form( &#039;genesis_after_content&#039;, 15);\n\n\/\/ Remve The Original Tickets Form\n\/\/ remove_action( &#039;tribe_events_single_event_after_the_meta&#039;, $form_display_function, 5 );\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1145894","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>Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action -<\/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\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action -\" \/>\n<meta property=\"og:description\" content=\"Hi, We are using the event tickets plus in a custom post type wince we don&#8217;t need much in the way of calendar functionality. Our post type has a custom layout with our custom meta, some of which exists outside the main content area. So we are looking to move the tickets purchase form outside [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/\" \/>\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\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/\",\"name\":\"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-07-31T06:37:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/#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\":\"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action\"}]},{\"@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":"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action -","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\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/","og_locale":"en_US","og_type":"article","og_title":"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action -","og_description":"Hi, We are using the event tickets plus in a custom post type wince we don&#8217;t need much in the way of calendar functionality. Our post type has a custom layout with our custom meta, some of which exists outside the main content area. So we are looking to move the tickets purchase form outside [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/","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\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/","name":"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-07-31T06:37:50+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/moving-ticket-purchase-form-in-genesis-how-to-properly-apply-remove_action\/#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":"Moving Ticket Purchase Form in Genesis, How to Properly apply remove_action"}]},{"@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\/1145894","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\/1145894\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1145894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}