Created
January 23, 2020 20:57
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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