Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Created July 9, 2014 17:20
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 lorenzocaum/6683b64ea28589a1afc6 to your computer and use it in GitHub Desktop.
Save lorenzocaum/6683b64ea28589a1afc6 to your computer and use it in GitHub Desktop.
Remove zero option from MER in Event Espresso 3 and select 1 by default
<?php
//* Do NOT include the opening php tag
//* Remove the zero option in dropdown and set default to 1
function ee_remove_zero_from_dropdown() {
?>
<script>jQuery(document).ready(function(){
jQuery(".price_id").val(1);
jQuery('#event_espresso_refresh_total').trigger('click');
});
</script>
<script>
jQuery(document).ready(function () {
jQuery(".price_id option[value='0']").remove();
});
</script>
<?php
}
add_action( 'wp_footer', 'ee_remove_zero_from_dropdown' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment