Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created September 7, 2018 17:10
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/b9fc5928507721bb90dd470ebcbe00fe to your computer and use it in GitHub Desktop.
Save joshfeck/b9fc5928507721bb90dd470ebcbe00fe to your computer and use it in GitHub Desktop.
Event Espresso 4: show only the first ticket option that's on sale
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'wp_enqueue_scripts',
'my_ee_show_only_first_on_sale_ticket',
20
);
function my_ee_show_only_first_on_sale_ticket() {
$custom_js = 'jQuery(document).ready(function($){
$(".tckt-slctr-tbl-tr").hide();
$(".ticket-on-sale:first").show();
});';
wp_add_inline_script('ticket_selector', $custom_js);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment