Skip to content

Instantly share code, notes, and snippets.

@Apina
Created July 31, 2014 09:56
Show Gist options
  • Save Apina/de3c5b6f7ebe89fd16cb to your computer and use it in GitHub Desktop.
Save Apina/de3c5b6f7ebe89fd16cb to your computer and use it in GitHub Desktop.
Small plugin to make a ticket required by removing the 0 ticket option.
<?php
/*
Plugin Name: EE add JavaScript to make ticket required.
Description:
*/
/* Begin Adding Functions Below This Line */
function ee_1() {
if(is_singular('espresso_events')) {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
//Change the ID (ticket-selector-tbl-qty-slct-1680-1 in this case) to match the correct ticket.
jQuery('#ticket-selector-tbl-qty-slct-1680-1 option[value="0"]').remove();
});
</script>
<?php
}
}
add_action('wp_footer', 'ee_1', 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment