Created
February 27, 2020 10:47
-
-
Save fumikito/e92c936f33601e648e8fcc43610033dc to your computer and use it in GitHub Desktop.
Hide recaptcha v3 on every page with Contact Form 7
This file contains hidden or 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
<?php | |
/** | |
* Remove recaptcha if it's not contact form. | |
*/ | |
add_action( 'wp_enqueue_scripts', function() { | |
if ( is_singular() && has_shortcode( get_queried_object()->post_content, 'contact-form-7' ) ) { | |
return; | |
} | |
wp_deregister_script( 'google-recaptcha' ); | |
}, 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment