Skip to content

Instantly share code, notes, and snippets.

@ideadude
Last active July 26, 2019 20:30
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 ideadude/764f6d708f1c8edb71084e00af0ee0ce to your computer and use it in GitHub Desktop.
Save ideadude/764f6d708f1c8edb71084e00af0ee0ce to your computer and use it in GitHub Desktop.
Get iCheck checkboxes to work with PMPro Add PayPal Express
/**
* Fix iCheck radio buttons with PMPro Add PayPal Express and other
* tweaks that add radio buttons to checkout.
* Add this code into a snippet or customization plugin.
*/
function my_icheck_radio_button_fix() {
?>
<script>
jQuery(window).load(function() {
//click our radio button when icheck is clicked
jQuery('.iCheck-helper').click(function() {
jQuery(this).siblings('input[type=radio]').click();
});
//click icheck when our link/labels are clicked
jQuery('a.pmpro_radio').click(function() {
jQuery(this).prev().find('.iCheck-helper').click();
});
});
</script>
<?php
}
add_action( 'wp_footer', 'my_icheck_radio_button_fix', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment