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/gdpr-markup.php +28 -9 0.0.11 → 2.12.8 View file →
@@ -17,9 +17,8 @@
17 17 *
18 18 * @since 0.0.2
19 19 */
20 20 class GDPR_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.
@@ -26,15 +25,23 @@
26 25 * @since 0.0.2
27 26 */
28 27 public function __construct( $attributes ) {
29 28 $this->set_properties( $attributes );
30 - $this->set_input_label( __( 'I consent to have this website store my submitted information so they can respond to my inquiry.', 'sureforms' ) );
29 + $this->set_input_label( __( 'I consent to have this website store my information so they can respond to my inquiry.', 'sureforms' ) );
31 30 $this->set_error_msg( $attributes, 'srfm_gdpr_block_required_text' );
32 31 $this->slug = 'gdpr';
33 32 $this->required = true;
34 - $this->aria_require_attr = 'true';
33 + $this->data_require_attr = 'true';
35 34 $this->set_markup_properties();
36 35 $this->set_aria_described_by();
36 +
37 + // Translate the default GDPR consent text for frontend display.
38 + // Match both old ("submitted information") and new ("information") default strings for backward compatibility.
39 + if ( 'I consent to have this website store my information so they can respond to my inquiry.' === $this->label
40 + || 'I consent to have this website store my submitted information so they can respond to my inquiry.' === $this->label
41 + ) {
42 + $this->label = __( 'I consent to have this website store my information so they can respond to my inquiry.', 'sureforms' );
43 + }
37 44 }
38 45
39 46 /**
40 47 * Render the sureforms GDPR classic styling
@@ -39,9 +46,9 @@
39 46 /**
40 47 * Render the sureforms GDPR classic styling
41 48 *
42 49 * @since 0.0.2
43 - * @return string|boolean
50 + * @return string|bool
44 51 */
45 52 public function markup() {
46 53 $label_random_id = 'srfm-' . $this->slug . '-' . wp_rand();
47 54 ob_start(); ?>
@@ -48,19 +55,20 @@
48 55 <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 56 <div class="srfm-block-wrap">
50 57 <input class="srfm-input-common screen-reader-text srfm-input-<?php echo esc_attr( $this->slug ); ?>" id="<?php echo esc_attr( $label_random_id ); ?>" name="srfm-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?><?php echo esc_attr( $this->field_name ); ?>"
51 58 <?php echo ! empty( $this->aria_described_by ) ? "aria-describedby='" . esc_attr( trim( $this->aria_described_by ) ) . "'" : ''; ?>
52 - aria-required="<?php echo esc_attr( $this->aria_require_attr ); ?>" type="checkbox" <?php echo esc_attr( $this->checked_attr ); ?>/>
59 + 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 60 <label class="srfm-cbx" for="<?php echo esc_attr( $label_random_id ); ?>">
54 61 <span class="srfm-span-wrap">
55 - <svg class="srfm-check-icon" width="12px" height="10px">
62 + <svg class="srfm-check-icon" width="12px" height="10px" aria-hidden="true">
56 63 <use xlink:href="#srfm-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?>-check"></use>
57 64 </svg>
58 65 </span>
59 66 <span class="srfm-span-wrap srfm-block-label"><?php echo wp_kses( $this->label, $this->allowed_tags ); ?>
60 - <span class="srfm-required"> *</span></span>
67 + <span class="srfm-required" aria-hidden="true"> *</span>
68 + </span>
61 69 </label>
62 - <svg class="srfm-inline-svg">
70 + <svg class="srfm-inline-svg" aria-hidden="true">
63 71 <symbol id="srfm-<?php echo esc_attr( $this->slug ); ?>-<?php echo esc_attr( $this->block_id ); ?>-check" viewbox="0 0 12 10">
64 72 <polyline points="1.5 6 4.5 9 10.5 1"></polyline>
65 73 </symbol>
66 74 </svg>
@@ -70,7 +78,18 @@
70 78 <?php echo wp_kses_post( $this->error_msg_markup ); ?>
71 79 </div>
72 80 </div>
73 81 <?php
74 - return ob_get_clean();
82 + $markup = ob_get_clean();
83 +
84 + return apply_filters(
85 + 'srfm_block_field_markup',
86 + $markup,
87 + [
88 + 'slug' => $this->slug,
89 + 'field_name' => $this->field_name,
90 + 'is_editing' => $this->is_editing,
91 + 'attributes' => $this->attributes,
92 + ]
93 + );
75 94 }
76 95 }