PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Admin/Form/AdminFormManager.php +34 -7 2.03.3.1 View file →
@@ -1,5 +1,6 @@
1 1 <?php
2 +
2 3 /**
3 4 * Get set Form,fields
4 5 */
5 6
@@ -9,18 +10,44 @@
9 10 * FrontendFormManager class
10 11 */
11 12 use BitCode\BitForm\Core\Form\FormManager;
12 13
13 -final class AdminFormManager extends FormManager {
14 - public function __construct($form_id) {
14 +final class AdminFormManager extends FormManager
15 +{
16 + public function __construct($form_id)
17 + {
15 18 parent::__construct($form_id);
16 19 }
17 20
18 - public function getFormMetaData() {
21 + /**
22 + * Pinned to raw: the builder saves back what it reads, so a translated string
23 + * reaching it would overwrite the stored source language.
24 + *
25 + * @return string
26 + */
27 + protected function getEffectiveFormContentJson()
28 + {
29 + // $this->form is a WP_Error when the form was not found; indexing it here
30 + // fataled for callers that pass an unknown or empty form id
31 + $raw = $this->isExist() ? ($this->form[0]->form_content ?? '') : '';
32 + return is_string($raw) ? $raw : '';
33 + }
34 +
35 + public function getFormMetaData()
36 + {
37 + if (!$this->isExist()) {
38 + return [
39 + 'created_at' => null,
40 + 'views' => null,
41 + 'entries' => null,
42 + 'status' => null
43 + ];
44 + }
45 +
19 46 return [
20 - 'created_at' => static::$form[0]->created_at,
21 - 'views' => static::$form[0]->views,
22 - 'entries' => static::$form[0]->entries,
23 - 'status' => static::$form[0]->status
47 + 'created_at' => $this->form[0]->created_at,
48 + 'views' => $this->form[0]->views,
49 + 'entries' => $this->form[0]->entries,
50 + 'status' => $this->form[0]->status
24 51 ];
25 52 }
26 53 }