PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.7.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.7.0
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/API/BitForm_Public/BitForm_Public.php +6 -14 3.2.12.7.0 View file →
@@ -2,33 +2,25 @@
2 2
3 3 namespace BitCode\BitForm\API\BitForm_Public;
4 4
5 5 use BitCode\BitForm\Core\Database\ApiModel;
6 -use BitCode\BitForm\Core\Util\Utilities;
7 6
8 -class BitForm_Public
9 -{
10 - public static function getForms()
11 - {
7 +class BitForm_Public {
8 + public static function getForms() {
12 9 $db = new ApiModel();
13 10 $forms = $db->getForm();
14 11 return $forms;
15 12 }
16 13
17 - public static function getFields($formId)
18 - {
14 + public static function getFields($formId) {
19 15 $db = new ApiModel();
20 16 $formData = $db->getField($formId);
21 17 if (!empty($formData)) {
22 - $unset_types = ['paypal', 'razorpay', 'stripe', 'recaptcha', 'hcaptcha'];
23 - $formRow = Utilities::firstRow($formData);
24 - $formContent = Utilities::jsonObj($formRow->form_content ?? '');
25 - if (!$formContent || !isset($formContent->fields)) {
26 - return (object) [];
27 - }
18 + $unset_types = ['paypal', 'razorpay', 'stripe', 'recaptcha'];
19 + $formContent = json_decode($formData[0]->form_content);
28 20 foreach ($formContent->fields as $key => $field) {
29 21 if (in_array($field->typ, $unset_types)) {
30 - unset($formContent->fields->{$key});
22 + unset($formContent->fields->{$key}, $fieldsKey[$key]);
31 23 }
32 24 }
33 25 return $formContent->fields;
34 26 }