Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created January 23, 2020 20:57
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/34de599956148516f23f08552a908d38 to your computer and use it in GitHub Desktop.
Save joshfeck/34de599956148516f23f08552a908d38 to your computer and use it in GitHub Desktop.
Add this snippet to your Event Espresso 4/WordPress site and when you go to add a new event, the Address Question Group will be pre-selected by default.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE_event_editor_questions_notice',
'my_select_address_for_primary_question_groups'
);
function my_select_address_for_primary_question_groups() {
if( did_action(
'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__create_new'
)) {
echo '<script>jQuery(
"#espresso_events_Registration_Form_Hooks_Extend_primary_questions_metabox input[value=\'2\']"
)
.prop( "checked", true );</script>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment