• Resolved PaulMighty

    (@paulmighty)


    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

    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 to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter PaulMighty

    (@paulmighty)

    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.