PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | inc/fields/checkbox-markup.php +17 -9 0.0.13 → 2.12.8 View file →
@@ -17,9 +17,8 @@
17 17 *
18 18 * @since 0.0.1
19 19 */
20 20 class Checkbox_Markup extends Base {
21 -
22 21 /**
23 22 * Initialize the properties based on block attributes.
24 23 *
25 24 * @param array<mixed> $attributes Block attributes.
@@ -37,9 +36,9 @@
37 36 /**
38 37 * Render the sureforms checkbox classic styling
39 38 *
40 39 * @since 0.0.2
41 - * @return string|boolean
40 + * @return string|bool
42 41 */
43 42 public function markup() {
44 43
45 44 $label_random_id = 'srfm-' . $this->slug . '-' . wp_rand();
@@ -47,23 +46,23 @@
47 46 ob_start(); ?>
48 47 <div data-block-id="<?php echo esc_attr( $this->block_id ); ?>" class="srfm-block-single srfm-block srfm-<?php echo esc_attr( $this->slug ); ?>-block srf-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?>-block<?php echo esc_attr( $this->block_width ); ?><?php echo esc_attr( $this->class_name ); ?> <?php echo esc_attr( $this->conditional_class ); ?>">
49 48 <div class="srfm-block-wrap">
50 49 <input class="srfm-input-common screen-reader-text srfm-input-<?php echo esc_attr( $this->slug ); ?>" id="<?php echo esc_attr( $label_random_id ); ?>"
51 - <?php echo ! empty( $this->aria_described_by ) ? "aria-describedby='" . esc_attr( trim( $this->aria_described_by ) ) . "'" : ''; ?>
52 - name="srfm-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?><?php echo esc_attr( $this->field_name ); ?>" aria-required="<?php echo esc_attr( $this->aria_require_attr ); ?>" type="checkbox" <?php echo esc_attr( $this->checked_attr ); ?>/>
50 + <?php echo ! empty( $this->aria_described_by ) ? "aria-describedby='" . esc_attr( trim( $this->aria_described_by ) ) . "'" : ''; ?>
51 + name="srfm-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?><?php echo esc_attr( $this->field_name ); ?>" data-required="<?php echo esc_attr( $this->data_require_attr ); ?>" aria-required="<?php echo esc_attr( $this->data_require_attr ); ?>" type="checkbox" <?php echo esc_attr( $this->checked_attr ); ?>/>
53 52 <label class="srfm-cbx" for="<?php echo esc_attr( $label_random_id ); ?>">
54 53 <span class="srfm-span-wrap">
55 - <svg class="srfm-check-icon" width="12px" height="10px">
54 + <svg class="srfm-check-icon" width="12px" height="10px" aria-hidden="true">
56 55 <use xlink:href="#srfm-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?>-check"></use>
57 56 </svg>
58 57 </span>
59 58 <span class="srfm-span-wrap srfm-block-label"><?php echo wp_kses( $this->label, $this->allowed_tags ); ?>
60 59 <?php if ( $this->required ) { ?>
61 - <span class="srfm-required"> *</span>
60 + <span class="srfm-required" aria-hidden="true"> *</span>
62 61 <?php } ?>
63 62 </span>
64 63 </label>
65 - <svg class="srfm-inline-svg">
64 + <svg class="srfm-inline-svg" aria-hidden="true">
66 65 <symbol id="srfm-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?>-check" viewbox="0 0 12 10">
67 66 <polyline points="1.5 6 4.5 9 10.5 1"></polyline>
68 67 </symbol>
69 68 </svg>
@@ -73,10 +72,19 @@
73 72 <?php echo wp_kses_post( $this->error_msg_markup ); ?>
74 73 </div>
75 74 </div>
76 75 <?php
76 + $markup = ob_get_clean();
77 77
78 - return ob_get_clean();
79 -
78 + return apply_filters(
79 + 'srfm_block_field_markup',
80 + $markup,
81 + [
82 + 'slug' => $this->slug,
83 + 'is_editing' => $this->is_editing,
84 + 'field_name' => $this->field_name,
85 + 'attributes' => $this->attributes,
86 + ]
87 + );
80 88 }
81 89
82 90 }