Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joshfeck/a70a2ae57e763047b70cafbdd4f61624 to your computer and use it in GitHub Desktop.
Save joshfeck/a70a2ae57e763047b70cafbdd4f61624 to your computer and use it in GitHub Desktop.
When creating an event this sets the “Personal Information” question group checkbox checked by default for the “Questions for Additional Registrants” section, so that the administrator won’t forget to tick the box.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__create_new',
'ee_custom_checkboxes_for_additional_question_groups_hook'
);
function ee_custom_checkboxes_for_additional_question_groups_hook() {
add_action(
'AHEE_event_editor_questions_notice',
'ee_custom_checkboxes_for_additional_question_groups'
);
}
function ee_custom_checkboxes_for_additional_question_groups() {
echo '<script>jQuery( document ).ready(function($) {
$("#espresso_events_Registration_Form_Hooks_Extend_additional_questions_metabox input[value=\'1\']")
.prop( "checked", true );
});</script>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment