Created
June 11, 2018 15:06
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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