codenathan
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Stripe Payment Gateway] Deactivating plugin before woocommerceMy aim was not to deactivate any plugins but I was investigating an error on my website, so on my local development environment, I was trying to see if any of the plugins were causing the issues, I was deactivating them one by one but was not following any particular order when I noticed this.
Forum: Plugins
In reply to: [Contact Form 7] FIX – Protected by Recaptcha Showing on all pagesWould be great if Mr @takayukister implemented this in the plugin. in the settings page. Unfortunately, I am too busy with projects to do this.
@alios24 that’s where you are wrong, you can create child themes, the guys who made Divi created a post about it.
https://www.elegantthemes.com/blog/divi-resources/divi-child-theme
just create a child theme and have your own functions.php nothing else, you can even have your own style.css
Forum: Plugins
In reply to: [Contact Form 7] FIX – Protected by Recaptcha Showing on all pages@alios24 The CSS simply does hides the badge after this loads on the front-end of the website whereas the code I have provided stops it from loading altogether from the beginning from the back-end of the website unless its the contact page ( assuming you only have one page with a form)
Furthermore Contact Form 7 by default loads on every page as well. So if you want an extended code. use the following
/* CONTACT FORM 7 */ // Stop the CF7 CSS & JS FROM LOADING ON EVERY PAGE add_filter( 'wpcf7_load_js', '__return_false' ); add_filter( 'wpcf7_load_css', '__return_false' ); function disable_google_recaptcha_except_contact() { //Remove the captcha scripts if its not on the contact form if (!is_page(array( 'contact')) ) : wp_dequeue_script('wpcf7-recaptcha'); wp_dequeue_script('google-recaptcha'); else : // else if it is the contact form enqueue all the scripts related to CF7 if (function_exists('wpcf7_enqueue_scripts')) { wpcf7_enqueue_scripts(); } if (function_exists('wpcf7_enqueue_styles')) { wpcf7_enqueue_styles(); } endif; } add_action('wp_enqueue_scripts', 'disable_google_recaptcha_except_contact');
You can then further go about hiding the page on the contact form and simply stating at the bottom of the page you are using captcha :
Full Details here: https://developers.google.com/recaptcha/docs/faq#id-like-to-hide-the-recaptcha-badge.-what-is-allowed
@alios24 The CSS simply does hides the badge after this loads on the front-end of the website whereas the code I have provided stops it from loading altogether from the beginning from the back-end of the website unless its the contact page ( assuming you only have one page with a form)
Furthermore Contact Form 7 by default loads on every page as well. So if you want an extended code. use the following
/* CONTACT FORM 7 */ // Stop the CF7 CSS & JS FROM LOADING ON EVERY PAGE add_filter( 'wpcf7_load_js', '__return_false' ); add_filter( 'wpcf7_load_css', '__return_false' ); function disable_google_recaptcha_except_contact() { //Remove the captcha scripts if its not on the contact form if (!is_page(array( 'contact')) ) : wp_dequeue_script('wpcf7-recaptcha'); wp_dequeue_script('google-recaptcha'); else : // else if it is the contact form enqueue all the scripts related to CF7 if (function_exists('wpcf7_enqueue_scripts')) { wpcf7_enqueue_scripts(); } if (function_exists('wpcf7_enqueue_styles')) { wpcf7_enqueue_styles(); } endif; } add_action('wp_enqueue_scripts', 'disable_google_recaptcha_except_contact');
You can then further go about hiding the page on the contact form and simply stating at the bottom of the page you are using captcha :
Full Details here: https://developers.google.com/recaptcha/docs/faq#id-like-to-hide-the-recaptcha-badge.-what-is-allowed
- This reply was modified 4 years, 4 months ago by codenathan.
Forum: Plugins
In reply to: [Contact Form 7] FIX – Protected by Recaptcha Showing on all pagesJust created this as a fix for others