Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dparker1005/b7bd4ff05e606d2ef7ee8d04ada430d1 to your computer and use it in GitHub Desktop.

Select an option

Save dparker1005/b7bd4ff05e606d2ef7ee8d04ada430d1 to your computer and use it in GitHub Desktop.
Remove auto-renewal checkbox when discount code is entered. Should fix https://github.com/strangerstudios/pmpro-auto-renewal-checkbox/issues/7
<?php
// Copy from below here
function my_pmproarc_remove_checkbox_when_discount_code_applied( $discount_code, $discount_code_id, $level_id, $code_level ) {
if ( ! empty( $code_level ) ) {
echo 'jQuery( "#pmpro_autorenewal_checkbox" ).remove()';
}
}
add_action( 'pmpro_applydiscountcode_return_js', 'my_pmproarc_remove_checkbox_when_discount_code_applied', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment