Created
November 1, 2020 23:11
-
-
Save r007/b95888206f9924e7778ed51ef9f77f4f to your computer and use it in GitHub Desktop.
Checkout Editor Fields Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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