PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.11.0
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.11.0
2.11.0 2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 All 78 releases
← All changes | Modules/Integrations/FluentCart/Paywalls.php +7 -5 2.6.02.11.0 View file →
@@ -36,8 +36,9 @@
36 36
37 37 $checkIds = $space->type == 'course' ? 'course_ids' : 'space_ids';
38 38
39 39 foreach ($communityIntegrations as $integration) {
40 + /** @var \FluentCart\App\Models\ProductMeta $integration */
40 41 $data = $integration->meta_value;
41 42 $isEnabled = Arr::get($data, 'enabled', 'no');
42 43 $eventTrigger = Arr::get($data, 'event_trigger');
43 44 if ($isEnabled != 'yes' || !$eventTrigger || !in_array('order_paid_done', $eventTrigger)) {
@@ -98,8 +99,9 @@
98 99
99 100 $checkIds = $space->type == 'course' ? 'course_ids' : 'space_ids';
100 101
101 102 foreach ($communityIntegrations as $integration) {
103 + /** @var \FluentCart\App\Models\ProductMeta $integration */
102 104 $data = $integration->meta_value;
103 105 $isEnabled = Arr::get($data, 'enabled', 'no');
104 106 $eventTrigger = Arr::get($data, 'event_trigger');
105 107 if ($isEnabled != 'yes' || !$eventTrigger || !in_array('order_paid_done', $eventTrigger)) {
@@ -160,13 +162,13 @@
160 162 }
161 163
162 164 public function maybeFormatPaywallField($field, $value)
163 165 {
164 - if ($value['type'] != 'paywall') {
165 - return $value;
166 + if (Arr::get($value, 'type') != 'paywall') {
167 + return $field;
166 168 }
167 169
168 - $value['paywalls'] = array_values(array_filter(
170 + $field['paywalls'] = array_values(array_filter(
169 171 array_map(function($paywall) {
170 172 return sanitize_text_field($paywall);
171 173 }, $value['paywalls'] ?? []),
172 174 function($paywall) {
@@ -173,9 +175,9 @@
173 175 return !empty($paywall) && is_numeric($paywall);
174 176 }
175 177 ));
176 178
177 - $value['show_description'] = Arr::get($value, 'show_description') == 'yes' ? 'yes' : 'no';
179 + $field['show_description'] = Arr::get($value, 'show_description') == 'yes' ? 'yes' : 'no';
178 180
179 - return $value;
181 + return $field;
180 182 }
181 183 }