Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active June 21, 2017 09:09
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/e67cc5f8fae20e5ae08380f43f5c3b93 to your computer and use it in GitHub Desktop.
Save Pebblo/e67cc5f8fae20e5ae08380f43f5c3b93 to your computer and use it in GitHub Desktop.
A simple example of how to set all EE checkbox questions to have all options checked.
<?php //Please do not include the opening PHP tag if you already have one
function ee_set_checkboxes_checked() {
wp_add_inline_script(
'single_page_checkout',
'jQuery( document ).ready(function($) {
$( ".ee-reg-qstn:checkbox").prop( "checked", true );
});'
);
}
add_action( 'wp_enqueue_scripts', 'ee_set_checkboxes_checked', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment