| | |
| | | |
| | | 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(); |
| | |
| | | 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>'; |
| | | } |
| | | } |
| | | |
| | |
| | | ]; |
| | | } |
| | | |
| | | 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, |