| | |
| | | { |
| | | $this->cache = Cache::for('forms', null, WEEK_IN_SECONDS); |
| | | |
| | | if (JVB_TESTING) { |
| | | $this->cache->flush(); |
| | | } |
| | | |
| | | // Initialize forms from filter |
| | | $this->forms = $this->registerForms(); |
| | | $this->form_contact = apply_filters('jvb_form_contact', ''); |
| | |
| | | $forms = apply_filters('jvb_register_forms', $default_forms); |
| | | |
| | | // Process forms to ensure they have proper structure |
| | | $processed_forms = []; |
| | | foreach ($forms as $form_key => $form_config) { |
| | | $processed_forms[$form_key] = $this->processFormConfig($form_config); |
| | | } |
| | | $processed_forms = array_map(function ($form_config) { |
| | | return $this->processFormConfig($form_config); |
| | | }, $forms); |
| | | |
| | | return $processed_forms; |
| | | } |