• The current code of invisible-recaptcha plugin has an error that prevents the correct behaviour of the action hook google_invre_render_widget_action if it’s called inside a nested form (that is, a form that is embedded in other form).

    I know that nested forms are not compliant to HTML standard, but as they are supported by all modern browsers I think your plugin might support them as well.

    In order to support them, I’ve added the following line to the renderInvisibleReCaptcha javascript function:

    if ( ! jQuery(holder).closest('form').is(form) ) continue;

    A version not depending on jQuery could be implemented, but my project works with jQuery.

    Without this line, this function will try to create the recaptcha inputs several times for the nested form, and it won’t work.

  • The topic ‘Problem when using hook if the form is inside other form’ is closed to new replies.