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/8f7331ef2e418ab1bd0e26716e1eb1d0 to your computer and use it in GitHub Desktop.
Save Pebblo/8f7331ef2e418ab1bd0e26716e1eb1d0 to your computer and use it in GitHub Desktop.
An example of how you can use jQuery to check all of EE's "Primary Registrant" questions groups when creating a new event. #EE #eventeditor #jquery
<?php //Please do not include the opening PHP tag if you already have one
add_action(
'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__create_new',
'tw_ee_check_all_checkboxes_for_primary_question_groups_on_create'
);
function tw_ee_check_all_checkboxes_for_primary_question_groups_on_create() {
add_action(
'AHEE_event_editor_questions_notice',
'tw_ee_custom_checkboxes_for_primary_question_groups'
);
}
function tw_ee_custom_checkboxes_for_primary_question_groups() {
echo '<script>jQuery( document ).ready(function($) {
$("#espresso_events_Registration_Form_Hooks_Extend_primary_questions_metabox input")
.prop( "checked", true );
});</script>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment