From a24a06002081ad71a78ffeff9072725ba39cf121 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 17 Feb 2026 20:05:31 +0000
Subject: [PATCH] =minor changes, particularly around the JVB_CHILD_URL pattern

---
 inc/blocks/FormBlock.php |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/inc/blocks/FormBlock.php b/inc/blocks/FormBlock.php
index 3e8a892..bfe7840 100644
--- a/inc/blocks/FormBlock.php
+++ b/inc/blocks/FormBlock.php
@@ -2,11 +2,8 @@
 namespace JVBase\blocks;
 
 use JVBase\managers\Cache;
-use JVBase\meta\MetaManager;
-use JVBase\managers\CloudflareTurnstile;
-use Exception;
+use JVBase\meta\Form;
 use JVBase\utility\Features;
-use WP_Block;
 
 if (!defined('ABSPATH')) {
 	exit; // Exit if accessed directly
@@ -181,7 +178,6 @@
 		$this->renderTurnstile();
 		$this->renderFormEnd($type, $form_id);
 		echo '</div>';
-
 		return ob_get_clean();
 	}
 
@@ -294,17 +290,14 @@
 			return;
 		}
 
-		// Create MetaManager instance for form rendering
-		$meta = new MetaManager();
-
 		// If sections are defined, render in sections
 		if (!empty($form_config['sections'])) {
-			$this->renderSections($type, $meta);
+			$this->renderSections($type);
 		} else {
 			echo jvbFormStatus();
 			// Render fields directly
 			foreach ($form_config['fields'] as $field_name => $field_config) {
-				$meta->render('form', $field_name, $field_config);
+				echo Form::render($field_name, null, $field_config);
 			}
 			$submit_text = $form_config['submit'] ?? 'Submit';
 			echo '<button type="submit" class="button primary">' . esc_html($submit_text) . '</button>';
@@ -314,7 +307,7 @@
 	/**
 	 * Render form sections
 	 */
-	protected function renderSections(string $type, MetaManager $meta): void
+	protected function renderSections(string $type): void
 	{
 		$form_config = $this->forms[$type];
 		$sections = $form_config['sections'];
@@ -369,7 +362,7 @@
 			});
 
 			foreach ($section_fields as $field_name => $field_config) {
-				$meta->render('form', $field_name, $field_config);
+				echo Form::render($field_name, null, $field_config);
 			}
 
 			// Add step navigation buttons

--
Gitblit v1.10.0