Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joshfeck/70ef3d761d1e3bf4228a1e015ff312b6 to your computer and use it in GitHub Desktop.
Save joshfeck/70ef3d761d1e3bf4228a1e015ff312b6 to your computer and use it in GitHub Desktop.
Check a question group box by default. For the Event Espresso 4 event editor. Primary Question group ID 3.
<?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_primary_question_groups' );
function my_custom_checkboxes_for_primary_question_groups() {
echo '<script>jQuery(
"#espresso_events_Registration_Form_Hooks_Extend_primary_questions_metabox input[value=\'3\']"
)
.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 Primary Registrant
  • Change the 3 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