Skip to content

Instantly share code, notes, and snippets.

@r007
Created November 1, 2020 23:11
Show Gist options
  • Save r007/b95888206f9924e7778ed51ef9f77f4f to your computer and use it in GitHub Desktop.
Save r007/b95888206f9924e7778ed51ef9f77f4f to your computer and use it in GitHub Desktop.
Checkout Editor Fields Bug
/**
* Fix form on checkout page (guest post order)
*/
add_action( 'wp_footer', 'soar_repeat_rule_settings', 99 );
function soar_repeat_rule_settings() {
if ( is_checkout() ) {
?>
<script type="text/javascript">
(function($) {
$('.input-radio').click(function() {
var value = $(this).val();
if (value == 'your_own_post') {
$(this).closest('.thwcfe-checkout-section').find('.form-hide').removeClass('form-hide').addClass('form-show');
} else {
$(this).closest('.thwcfe-checkout-section').find('.form-show').removeClass('form-show').addClass('form-hide');
}
});
})(jQuery, window, document)
</script>
<?php
}
}
.form-hide { display: none !important; }
.form-show { display: block !important; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment