Title: reCAPTCHA Advanced Example
Last modified: February 27, 2020

---

# reCAPTCHA Advanced Example

 *  Resolved [PaulMighty](https://wordpress.org/support/users/paulmighty/)
 * (@paulmighty)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/recaptcha-advanced-example/)
 * Hello,
 * Thanks for the awesome plugin! Working to get the reCAPTCHA example in the docs
   working on my website. Have all the reCAPTCHA code in my functions.php from the
   advanced example in the Age Gate docs:
    [https://agegate.io/docs/guides/custom-form-fields/advanced-example](https://agegate.io/docs/guides/custom-form-fields/advanced-example)
 * The div is created, but the issue is that when submitting the form, my debugging
   logs the following error:
 *     ```
       PHP Fatal error:  Uncaught Exception: Validator method 'validate_recaptcha' does not exist. in /app/public/wp-content/plugins/age-gate/vendor/wixel/gump/gump.class.php:457
       Stack trace:
       #0 /app/public/wp-content/plugins/age-gate/vendor/wixel/gump/gump.class.php(277): GUMP->validate(Array, Array, '|', ',')
       #1 /app/public/wp-content/plugins/age-gate/vendor/wixel/gump/gump.class.php(105): GUMP->run(Array)
       #2 /app/public/wp-content/plugins/age-gate/public/class-age-gate-public-js.php(420): GUMP::is_valid(Array, Array)
       #3 /app/public/wp-content/plugins/age-gate/public/class-age-gate-public-js.php(221): Age_Gate_Public_JS->_validate(Array)
       #4 /app/public/wp-content/plugins/age-gate/public/class-age-gate-public-js.php(200): Age_Gate_Public_JS->_handle_input_submission(Array)
       #5 /app/public/wp-includes/class-wp-hook.php(288): Age_Gate_Public_JS->handle_ajax_form_submission(Array)
       #6 /app/public/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters('', Array)
       #7 /app/public/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
       #8 /a in /app/public/wp-content/plugins/age-gate/vendor/wixel/gump/gump.class.php on line 457
       ```
   
 * What am I doing wrong?
 * Thank you!
    -Paul Mighty
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frecaptcha-advanced-example%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [PaulMighty](https://wordpress.org/support/users/paulmighty/)
 * (@paulmighty)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/recaptcha-advanced-example/#post-12488695)
 * I think I figured it out with a bit of self-service 🙂
 * Adding an after_setup_theme action gets the custom validation working:
 *     ```
       add_action('age_gate_add_validators', 'my_recaptcha_validation' );
       add_action( 'after_setup_theme', function() {
       	do_action('age_gate_add_validators');
       } );
       ```
   
 * Seems it need to run do_action again after the theme setup. Maybe add to the 
   docs?
 * Thanks for a great plugin 🙂
 * Cheers,
    -Paul Mighty

Viewing 1 replies (of 1 total)

The topic ‘reCAPTCHA Advanced Example’ is closed to new replies.

 * ![](https://ps.w.org/age-gate/assets/icon-256x256.png?rev=2783003)
 * [Age Gate](https://wordpress.org/plugins/age-gate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/age-gate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/age-gate/)
 * [Active Topics](https://wordpress.org/support/plugin/age-gate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/age-gate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/age-gate/reviews/)

## Tags

 * [agegate](https://wordpress.org/support/topic-tag/agegate/)
 * [reCAPTCHA](https://wordpress.org/support/topic-tag/recaptcha/)

 * 1 reply
 * 1 participant
 * Last reply from: [PaulMighty](https://wordpress.org/support/users/paulmighty/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/recaptcha-advanced-example/#post-12488695)
 * Status: resolved