Skip to content

Instantly share code, notes, and snippets.

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 Pebblo/8ac8fe9b1e7303dec003793dbeb1d021 to your computer and use it in GitHub Desktop.
Save Pebblo/8ac8fe9b1e7303dec003793dbeb1d021 to your computer and use it in GitHub Desktop.
Check a question group box by default. For the Event Espresso 4 event editor. Additional Question group ID 1 (Personal Information).
<?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_custom_checkboxes_for_additional_question_groups' );
function my_custom_checkboxes_for_additional_question_groups() {
echo '<script>jQuery(
"#espresso_events_Registration_Form_Hooks_Extend_additional_questions_metabox input[value=\'1\']"
)
.prop( "checked", true );</script>';
}

Usage instructions

  • Add the code to your custom functions plugin.
  • Find the question group ID for the question group that you want to always have checked for the Additional Registrants
  • Change the 1 in the above code to match your question group ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment