PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
← All changes | app/Services/EditorShortCodeParser.php +35 -1 2.4.0 → 2.5.0 View file →
@@ -302,12 +302,46 @@
302 302 return $guest->getTotalGuestCount();
303 303 }
304 304
305 305 if ($key == 'form_data_html') {
306 - return __('will be available soon', 'fluent-booking');
306 + // isPublic: hidden fields stay out, the recipient may be the guest.
307 + return self::renderFormData(
308 + BookingFieldService::getFormattedCustomBookingData($guest, static::$requireHtml, true),
309 + static::$requireHtml
310 + );
307 311 }
308 312
309 313 return self::resolveScalarAttribute($guest, $key);
314 + }
315 +
316 + protected static function renderFormData($fields, $isHtml)
317 + {
318 + $rows = '';
319 +
320 + foreach ($fields as $field) {
321 + $value = Arr::get($field, 'value');
322 +
323 + if ($value === '' || $value === null || $value === []) {
324 + continue;
325 + }
326 +
327 + if (!$isHtml) {
328 + $rows .= $field['label'] . ': ' . $value . PHP_EOL;
329 + continue;
330 + }
331 +
332 + // File values are download anchors; everything else is raw guest input.
333 + $value = Arr::get($field, 'type') == 'file' ? wp_kses_post($value) : nl2br(esc_html($value));
334 +
335 + $rows .= '<tr><th style="padding:6px 12px;background-color:#f8f8f8;text-align:' . (is_rtl() ? 'right' : 'left') . ';">' . esc_html($field['label']) . '</th></tr>'
336 + . '<tr><td style="padding:6px 12px 12px 12px;">' . $value . '</td></tr>';
337 + }
338 +
339 + if (!$isHtml || !$rows) {
340 + return trim($rows);
341 + }
342 +
343 + return '<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse;"><tbody>' . $rows . '</tbody></table>';
310 344 }
311 345
312 346 protected static function getBookingEventData($key)
313 347 {