PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / FormBuilder / Components / CustomHtml.php

CustomHtml.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.14, at app/Services/FormBuilder/Components/CustomHtml.php

57 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Services\FormBuilder\Components;
4
5 use FluentForm\Framework\Helpers\ArrayHelper;
6
7 class CustomHtml extends BaseComponent
8 {
9 /**
10 * Compile and echo the html element
11 *
12 * @param array $data [element data]
13 * @param \stdClass $form [Form Object]
14 *
15 * @return void
16 */
17 public function compile($data, $form)
18 {
19 $elementName = $data['element'];
20 $data = apply_filters_deprecated(
21 'fluentform_rendering_field_data_' . $elementName,
22 [
23 $data,
24 $form
25 ],
26 FLUENTFORM_FRAMEWORK_UPGRADE,
27 'fluentform/rendering_field_data_' . $elementName,
28 'Use fluentform/rendering_field_data_' . $elementName . ' instead of fluentform_rendering_field_data_' . $elementName
29 );
30 $data = apply_filters('fluentform/rendering_field_data_' . $elementName, $data, $form);
31
32 $hasConditions = $this->hasConditions($data) ? 'has-conditions ' : '';
33 $cls = trim($this->getDefaultContainerClass() . ' ff-' . $elementName . ' ' . $hasConditions);
34 if ($containerClass = ArrayHelper::get($data, 'settings.container_class')) {
35 $cls .= ' ' . $containerClass;
36 }
37 $atts = $this->buildAttributes(
38 ArrayHelper::except($data['attributes'], 'name')
39 );
40 $html = "<div class='" . esc_attr($cls) . "' tabindex='-1' {$atts}>" . fluentform_sanitize_html($data['settings']['html_codes']) . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts is escaped before being passed in.
41
42 $html = apply_filters_deprecated(
43 'fluentform_rendering_field_html_' . $elementName,
44 [
45 $html,
46 $data,
47 $form
48 ],
49 FLUENTFORM_FRAMEWORK_UPGRADE,
50 'fluentform/rendering_field_html_' . $elementName,
51 'Use fluentform/rendering_field_html_' . $elementName . ' instead of fluentform_rendering_field_html_' . $elementName
52 );
53
54 $this->printContent('fluentform/rendering_field_html_' . $elementName, $html, $data, $form);
55 }
56 }
57