From 3aada9949d51024a92a8b5c6cb70d12f9c3cac16 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 21 Dec 2025 19:59:48 +0000
Subject: [PATCH] =auth refactored via rest, referral system set up for Jane, some javascript consolidation
---
inc/blocks/FormBlock.php | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/inc/blocks/FormBlock.php b/inc/blocks/FormBlock.php
index 369ce77..b8f4ed9 100644
--- a/inc/blocks/FormBlock.php
+++ b/inc/blocks/FormBlock.php
@@ -35,7 +35,7 @@
public function __construct()
{
- $this->cache = new CacheManager('form_blocks', HOUR_IN_SECONDS);
+ $this->cache = CacheManager::for('form_blocks', WEEK_IN_SECONDS);
// Initialize forms from filter
$this->forms = $this->registerForms();
@@ -52,7 +52,8 @@
public function registerBlock()
{
register_block_type($this->path, [
- 'render_callback' => [$this, 'render']
+ 'render_callback' => [$this, 'render'],
+ 'style' => 'jvb-icons-forms',
]);
}
@@ -289,6 +290,8 @@
foreach ($form_config['fields'] as $field_name => $field_config) {
$meta->render('form', $field_name, $field_config);
}
+ $submit_text = $form_config['submit'] ?? 'Submit';
+ echo '<button type="submit" class="button primary">' . esc_html($submit_text) . '</button>';
}
}
@@ -435,11 +438,6 @@
];
}
- error_log('Form Localization: '.print_r([
- 'formTypes' => $form_types,
- 'availableForms' => $this->forms,
- 'nonce' => wp_create_nonce('jvbForm')
- ], true));
wp_localize_script('jvb-forms-editor-script', 'jvbFormsData', [
'formTypes' => $form_types,
'availableForms' => $this->forms,
--
Gitblit v1.10.0