Skip to content

Instantly share code, notes, and snippets.

View andrewinsidelazarev's full-sized avatar

Andrew Lazarev andrewinsidelazarev

View GitHub Profile
@andrewinsidelazarev
andrewinsidelazarev / checkout-functions.php
Created February 7, 2023 11:11 — forked from doubleedesign/checkout-functions.php
Add reCaptcha v2 to WooCommerce Checkout
<?php
/**
* Add reCaptcha to checkout form
* Note: Can't place within the payment part of the form, WooCommerce just won't show it, choose an appropriate action to add it to accordingly
* @param $checkout
*/
function doublee_show_me_the_checkout_captcha($checkout) {
echo '<div class="g-recaptcha" data-sitekey="YOUR_KEY_HERE"></div>';
}
add_action('woocommerce_checkout_order_review', 'doublee_show_me_the_checkout_captcha', 18);