Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
Created October 7, 2016 20:24
Show Gist options
  • Save GeoffEW/c1e4a2096b9af920b79cda20096ae486 to your computer and use it in GitHub Desktop.
Save GeoffEW/c1e4a2096b9af920b79cda20096ae486 to your computer and use it in GitHub Desktop.
Moves ticket form in a normal post type (page, post)
<?php
if ( class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) {
// remove default action
remove_filter ( 'the_content', array( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), 'front_end_tickets_form_in_content' ), 11 );
function custom_front_end_tickets_form_in_content( $content ) {
$woo = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
$woo->front_end_tickets_form( $content );
return $content;
}
// rehook a custom action
add_filter ( 'the_content', 'custom_front_end_tickets_form_in_content' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment