Fluent Forms embed endpoint for Astro

/** * Fluent Forms embed endpoint for Astro * * Test first: * https://connect.carfit-hamburg.de/?ff_embed=1&form_id=11 * * Then test pretty URL: * https://connect.carfit-hamburg.de/ff-embed/?form_id=11 */ add_action(‘init’, function () { add_rewrite_tag(‘%ff_embed%’, ‘([^&]+)’); add_rewrite_rule(‘^ff-embed/?$’, ‘index.php?ff_embed=1’, ‘top’); }); add_filter(‘query_vars’, function ($vars) { $vars[] = ‘ff_embed’;…Continue reading

Custom Fluent Forms REST submit route

add_action(‘fluentform/loaded’, function ($app) { $app->router->post(‘/test-submit’, function () use ($app) { try { $rawData = $app->request->get(‘data’); if (is_string($rawData)) { parse_str($rawData, $data); } elseif (is_array($rawData)) { $data = $rawData; } else { $data = []; } $data[‘_wp_http_referer’] = isset($data[‘_wp_http_referer’]) ? sanitize_url(urldecode($data[‘_wp_http_referer’])) :…Continue reading