Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active September 19, 2015 20:04
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/ef02326277e672fe2d5c to your computer and use it in GitHub Desktop.
Save lorenzocaum/ef02326277e672fe2d5c to your computer and use it in GitHub Desktop.
Set the ticket selector to off by default for new events in the event editor for Event Espresso 4

Add the sample code below to your child theme's functions.php file or in a site specific plugin.

<?php
//* Do NOT include the opening php tag
function ee4_event_editor_default_ticket_selector_off(){
?>
<script>
jQuery(document).ready(function ($) {
   if ($('#titlewrap:contains("Enter event title here")').length > 0) {
        $("select[id='display_ticket_selector']").val('');
    }
});
</script>
<?php
}
add_action('AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add', 'ee4_event_editor_default_ticket_selector_off');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment