| | |
| | | |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Form; |
| | | use JVBase\utility\Features; |
| | | use JVBase\base\Site; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; // Exit if accessed directly |
| | |
| | | public function __construct() |
| | | { |
| | | $this->cache = Cache::for('forms', WEEK_IN_SECONDS); |
| | | |
| | | // Initialize forms from filter |
| | | $this->forms = $this->registerForms(); |
| | | $this->form_contact = apply_filters('jvb_form_contact', ''); |
| | | |
| | | |
| | | // Hook into the CustomBlocks render system |
| | | add_filter('jvb_render_block_jvb_forms', [$this, 'render'], 10, 2); |
| | | |
| | |
| | | } |
| | | |
| | | // Enqueue Turnstile if needed |
| | | if (Features::forSite()->hasIntegration('cloudflare')) { |
| | | if (Site::hasIntegration('cloudflare')) { |
| | | $cloudflare = JVB()->connect('cloudflare'); |
| | | if ($cloudflare->isSetUp()) { |
| | | $cloudflare->enqueueTurnstileScripts(); |
| | |
| | | */ |
| | | protected function renderTurnstile(): void |
| | | { |
| | | if (!Features::hasIntegration('cloudflare')) { |
| | | if (!Site::hasIntegration('cloudflare')) { |
| | | return; |
| | | } |
| | | |