|
3 | 3 | namespace BitCode\FI\Triggers\Elementor; |
4 | 4 |
|
5 | 5 | use BitCode\FI\Flow\Flow; |
6 | | -use BitCode\FI\Triggers\TriggerController; |
7 | 6 |
|
8 | 7 | final class ElementorController |
9 | 8 | { |
@@ -50,30 +49,20 @@ public static function pluginActive($option = null) |
50 | 49 | return (bool) (is_plugin_active('elementor-pro/elementor-pro.php') || is_plugin_active('elementor/elementor.php')); |
51 | 50 | } |
52 | 51 |
|
53 | | - public function getTestData() |
54 | | - { |
55 | | - return TriggerController::getTestData('elementor'); |
56 | | - } |
57 | | - |
58 | | - public function removeTestData($data) |
59 | | - { |
60 | | - return TriggerController::removeTestData($data, 'elementor'); |
61 | | - } |
62 | | - |
63 | 52 | public static function handle_elementor_submit($record) |
64 | 53 | { |
65 | 54 | $recordData = ElementorHelper::extractRecordData($record); |
66 | 55 | $formData = ElementorHelper::setFields($recordData); |
67 | 56 | $reOrganizeId = $recordData['id'] . $recordData['form_post_id']; |
68 | 57 |
|
69 | | - if (get_option('btcbi_elementor_test') !== false) { |
70 | | - update_option('btcbi_elementor_test', [ |
| 58 | + if (get_option('btcbi_elementor_pro/forms/new_record_test') !== false) { |
| 59 | + update_option('btcbi_elementor_pro/forms/new_record_test', [ |
71 | 60 | 'formData' => $formData, |
72 | 61 | 'primaryKey' => [(object) ['key' => 'id', 'value' => $recordData['id']]] |
73 | 62 | ]); |
74 | 63 | } |
75 | 64 |
|
76 | | - $flows = ElementorHelper::fetchFlows($recordData['id'], $reOrganizeId); |
| 65 | + $flows = Flow::exists('Elementor', ['elementor_pro/forms/new_record', $recordData['id'], $reOrganizeId]); |
77 | 66 | if (!$flows) { |
78 | 67 | return; |
79 | 68 | } |
|
0 commit comments