Skip to content

Commit cffe1fc

Browse files
release: fixes
- Fixed issue with HTML Output being displayed on fields in the front-end - Fixed collapse menu issue with conditional fields
2 parents e06994a + 57ed73f commit cffe1fc

File tree

10 files changed

+30
-87
lines changed

10 files changed

+30
-87
lines changed

classes/form.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ function( $collapse_field ) {
219219
$field_html .= '</div>';
220220

221221
if ( count( $collapse_fields ) === $ppom_collapse_counter && $section_started ) {
222-
$field_html .= '</div>';
223222
$section_started = false;
224223
}
225224

classes/plugin.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,8 @@ public function show_tooltip( $description, $meta ) {
977977
$input_desc = wp_strip_all_tags( html_entity_decode( $input_desc ) );
978978

979979
// Check if the tooltip is enabled.
980-
if ( ! empty( $input_desc ) && isset( $meta['desc_tooltip'] ) && 'on' === $meta['desc_tooltip'] ) {
981-
$description = ( ! empty( $meta['description'] ) ) ? ' <span data-ppom-tooltip="ppom_tooltip" class="ppom-tooltip" title="' . esc_attr( $input_desc ) . '"><svg width="13px" height="13px" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z"></path></svg></span>' : '';
980+
if ( isset( $meta['desc_tooltip'] ) && 'on' === $meta['desc_tooltip'] ) {
981+
$description = ( ! empty( $meta['description'] ) ) ? ' <span data-ppom-tooltip="ppom_tooltip" class="ppom-tooltip" title="' . esc_attr( $input_desc ) . '"><span class="ppom-tooltip-icon"></span></span>' : '';
982982
}
983983
return $description;
984984
}

css/ppom-style.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,4 +594,22 @@ div.filelist .u_i_c_box {
594594
[data-remodal-id^="ppom_textbox_model_"] {
595595
max-width: 700px !important;
596596
min-height: 0 !important;
597+
}
598+
599+
span.ppom-tooltip .ppom-tooltip-icon {
600+
width: 13px;
601+
height: 13px;
602+
font-size: 11px;
603+
line-height: 13px;
604+
background-color: #000;
605+
border-radius: 100%;
606+
display: inline-block;
607+
text-align: center
608+
}
609+
span.ppom-tooltip .ppom-tooltip-icon::after {
610+
content: '?';
611+
font-size: 10px;
612+
color: #fff;
613+
line-height: 13px;
614+
font-weight: 700;
597615
}

inc/validation.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function ppom_esc_html( $content ) {
7272
$allowedposttags['a'] = $allowed_atts;
7373
$allowedposttags['b'] = $allowed_atts;
7474
$allowedposttags['i'] = $allowed_atts;
75-
7675
$allowed_tags = wp_kses_allowed_html( 'post' );
7776

7877
return wp_kses( stripslashes_deep( $content ), $allowed_tags );

templates/frontend/inputs/checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function ( $v ) {
9595
// if discount price set
9696
if ( $has_discount ) {
9797
$price = $discount_price > 0 ? wc_format_sale_price( $option_price, $discount_price ) : wc_price( $option_price );
98-
$tooltip = $tooltip ? ' <span data-ppom-tooltip="ppom_tooltip" class="ppom-tooltip" title="' . esc_attr( $tooltip ) . '"><svg width="13px" height="13px" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z"></path></svg></span>' : '';
98+
$tooltip = $tooltip ? ' <span data-ppom-tooltip="ppom_tooltip" class="ppom-tooltip" title="' . esc_attr( $tooltip ) . '"><span class="ppom-tooltip-icon"></span></span>' : '';
9999
$the_label = $value['raw'] . $tooltip;
100100
$option_label = '<span class="ppom-cb-label">' . $the_label . '</span><span class="ppom-cb-price">' . $price . '</span>';
101101
}

templates/frontend/inputs/cropper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class="<?php echo esc_attr( $fm->field_inner_wrapper_classes() ); ?>">
4141
<!-- if title of field exist -->
4242
<?php if ( $field_label ) : ?>
4343
<label class="<?php echo esc_attr( $fm->label_classes() ); ?>"
44-
for="<?php echo esc_attr( $fm->data_name() ); ?>"><?php echo esc_html( $field_label ); ?></label>
44+
for="<?php echo esc_attr( $fm->data_name() ); ?>"><?php echo wp_kses( $field_label, array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></label>
4545
<?php endif ?>
4646

4747

templates/frontend/inputs/divider.php

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,7 @@
103103
if ( $divider_styles == 'style1' ) {
104104
if ( $fm->field_label() ) {
105105
?>
106-
<h2 class="ppom-divider-with-txt ppom-divider-line ppom-divider-line-clr ppom-divider-txt">
107-
<?php
108-
echo wp_kses(
109-
$fm->field_label(),
110-
array(
111-
'span' => array(
112-
'class' => true,
113-
),
114-
)
115-
);
116-
?>
117-
</h2>
106+
<h2 class="ppom-divider-with-txt ppom-divider-line ppom-divider-line-clr ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h2>
118107
<?php } else { ?>
119108
<hr class="ppom-divider-<?php echo esc_attr( $style1_border ); ?>">
120109
<?php
@@ -124,71 +113,27 @@
124113

125114
<!--Style 2-->
126115
<?php if ( $divider_styles == 'style2' ) { ?>
127-
<h2 class="ppom-divider-with-txt ppom-divider-gradient ppom-divider-txt">
128-
<?php
129-
echo wp_kses(
130-
$fm->field_label(),
131-
array(
132-
'span' => array(
133-
'class' => true,
134-
),
135-
)
136-
);
137-
?>
138-
</h2>
116+
<h2 class="ppom-divider-with-txt ppom-divider-gradient ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h2>
139117
<?php } ?>
140118

141119
<!--Style 3-->
142120
<?php if ( $divider_styles == 'style3' ) { ?>
143-
<h2 class="ppom-divider-with-txt ppom-divider-donotcross ppom-divider-txt">
144-
<?php
145-
echo wp_kses(
146-
$fm->field_label(),
147-
array(
148-
'span' => array(
149-
'class' => true,
150-
),
151-
)
152-
);
153-
?>
154-
</h2>
121+
<h2 class="ppom-divider-with-txt ppom-divider-donotcross ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h2>
155122
<?php } ?>
156123

157124
<!--Style 4-->
158125
<?php if ( $divider_styles == 'style4' ) { ?>
159126
<div class="ppom-divider-easy-shadow">
160127
<span></span>
161-
<span class="ppom-divider-txt">
162-
<?php
163-
echo wp_kses(
164-
$fm->field_label(),
165-
array(
166-
'span' => array(
167-
'class' => true,
168-
),
169-
)
170-
);
171-
?>
172-
</span>
128+
<span class="ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></span>
173129
<span></span>
174130
</div>
175131
<?php } ?>
176132

177133
<!--Style 5-->
178134
<?php if ( $divider_styles == 'style5' ) { ?>
179135

180-
<h1 class="ppom-divider-fancy-heading ppom-divider-txt">
181-
<?php
182-
echo wp_kses(
183-
$fm->field_label(),
184-
array(
185-
'span' => array(
186-
'class' => true,
187-
),
188-
)
189-
);
190-
?>
191-
</h1>
136+
<h1 class="ppom-divider-fancy-heading ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h1>
192137
<div class="ppom-divider-fancy-line">
193138
<span></span>
194139
</div>

templates/frontend/inputs/file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class="<?php echo esc_attr( $fm->field_inner_wrapper_classes() ); ?>">
3838
class="<?php echo esc_attr( $fm->label_classes() ); ?>"
3939
for="<?php echo esc_attr( $fm->data_name() ); ?>"
4040
>
41-
<?php echo esc_html( $field_label ); ?>
41+
<?php echo wp_kses( $field_label, array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?>
4242
</label>
4343
<?php endif ?>
4444

templates/frontend/inputs/quantities.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@
5151
class="<?php echo esc_attr( $fm->label_classes() ); ?>"
5252
for="<?php echo esc_attr( $fm->data_name() ); ?>"
5353
>
54-
<?php
55-
echo wp_kses(
56-
$fm->field_label(),
57-
array(
58-
'span' => array(
59-
'class' => true,
60-
),
61-
)
62-
);
63-
?>
54+
<?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?>
6455
</label>
6556
<?php endif ?>
6657

templates/frontend/inputs/text.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,7 @@
5454
class="<?php echo esc_attr( $fm->label_classes() ); ?>"
5555
for="<?php echo esc_attr( $fm->data_name() ); ?>"
5656
>
57-
<?php
58-
echo wp_kses(
59-
$fm->field_label(),
60-
array(
61-
'span' => array(
62-
'class' => true,
63-
),
64-
)
65-
);
66-
?>
57+
<?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?>
6758
</label>
6859
<?php endif ?>
6960

0 commit comments

Comments
 (0)