Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.