Skip to content

Integration with hCaptcha #19

@netserwisIT

Description

@netserwisIT

Hi @Log1x,
Is it possible to set higher priority to render function inside src/HtmlForms.php? The problem is that hCaptcha is looking for some part of HTML code to replace it with captcha fields. Unfortunately, it has the same priority inside filter 'af_form_html' and probably the blade view is rendered after. So the captcha fields are de facto not rendered.
I've tried this solution, and it worked for me.

    {
        add_filter('hf_form_html', function ($html, $form) {
            if (! view()->exists('forms.' . $form->slug)) {
                return $html;
            }

            return view(
                Str::start($form->slug, 'forms.'),
                ['form' => $form->ID]
            )->render();
        }, 5, 2);
    }

Or maybe you know a better solution for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions