Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created June 11, 2018 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/552ee76646d394d9a514bb84b3ad2e50 to your computer and use it in GitHub Desktop.
Save joshfeck/552ee76646d394d9a514bb84b3ad2e50 to your computer and use it in GitHub Desktop.
Adds a new shortcode that can be used to move the Event Espresso ticket selector table to a specific location within the Event's description text. Add this code to a plugin on the site, then add [ee_ticket_table] somewhere in the middle of the Event Description field.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_shortcode('ee_ticket_table', 'my_move_ticket_table_shortcode');
function my_move_ticket_table_shortcode() {
if(! is_single()) {
return;
}
$html = '<div id="ticket-table-loc"></div>';
$js = '<script>jQuery(document).ready(function($){
$(".event-tickets").appendTo("#ticket-table-loc");
});</script>';
return $html . $js;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment