PluginProbe ʕ •ᴥ•ʔ
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.1
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.1
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 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8 0.0.9 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.1.0 1.1.1 1.1.2 1.10.0 1.10.1 1.11.0 1.12.0 1.12.1 1.12.2 1.12.3 1.13.0 1.13.1 1.13.2 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.2 2.6.0
sureforms / inc / fields / address-markup.php
sureforms / inc / fields Last commit date
address-markup.php 1 month ago base.php 2 months ago checkbox-markup.php 1 year ago countries.json 1 year ago dropdown-markup.php 1 month ago email-markup.php 2 months ago gdpr-markup.php 4 months ago inlinebutton-markup.php 4 weeks ago input-markup.php 4 months ago multichoice-markup.php 1 month ago number-markup.php 4 months ago payment-markup.php 2 months ago phone-markup.php 1 month ago textarea-markup.php 1 month ago url-markup.php 4 months ago
address-markup.php
111 lines
1 <?php
2 /**
3 * Sureforms Address Markup Class file.
4 *
5 * @package sureforms.
6 * @since 0.0.1
7 */
8
9 namespace SRFM\Inc\Fields;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly.
13 }
14
15 /**
16 * Sureforms Address Markup Class.
17 *
18 * @since 0.0.1
19 */
20 class Address_Markup extends Base {
21 /**
22 * Initialize the properties based on block attributes.
23 *
24 * @param array<mixed> $attributes Block attributes.
25 * @since 0.0.2
26 */
27 public function __construct( $attributes ) {
28 $this->set_properties( $attributes );
29 $this->set_input_label( __( 'Address', 'sureforms' ) );
30 $this->slug = 'address';
31 $this->set_markup_properties();
32 }
33
34 /**
35 * Render the sureforms address classic styling
36 *
37 * @param string $content inner block content.
38 * @since 0.0.2
39 * @return string|bool
40 */
41 public function markup( $content = '' ) {
42 /**
43 * Filter extra CSS classes for the address field wrapper.
44 *
45 * @param array<string> $extra_classes Extra CSS classes.
46 * @param array<mixed> $attributes Block attributes.
47 * @since 2.8.0
48 */
49 $extra_classes = apply_filters( 'srfm_address_field_classes', [], $this->attributes );
50
51 $this->class_name = $this->get_field_classes( $extra_classes );
52
53 /**
54 * Filter additional HTML attributes for the address block wrapper div.
55 *
56 * IMPORTANT: Callbacks MUST escape all values with esc_attr() before
57 * returning. The output is echoed directly into a <div> tag.
58 *
59 * @param string $extra_attrs Additional HTML attributes string (pre-escaped).
60 * @param array<mixed> $attributes Block attributes.
61 * @since 2.8.0
62 */
63 $extra_attrs = apply_filters( 'srfm_address_block_attributes', '', $this->attributes );
64
65 ob_start(); ?>
66 <div data-block-id="<?php echo esc_attr( $this->block_id ); ?>" class="<?php echo esc_attr( $this->class_name ); ?>" data-slug="<?php echo esc_attr( $this->block_slug ); ?>"
67 <?php
68 echo $extra_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped by the filter callback.
69 ?>
70 >
71 <fieldset>
72 <legend class="srfm-block-legend">
73 <?php echo wp_kses_post( $this->label_markup ); ?>
74 </legend>
75 <?php echo wp_kses_post( $this->help_markup ); ?>
76 <?php
77 /**
78 * Fires after the address field legend, before the inner block content.
79 * Used by pro to render the autocomplete search input.
80 *
81 * @param array<mixed> $attributes Block attributes.
82 * @param string $block_id Block ID.
83 * @since 2.8.0
84 */
85 do_action( 'srfm_address_before_fields', $this->attributes, $this->block_id );
86 ?>
87 <div class="srfm-block-wrap">
88 <?php
89 // phpcs:ignore
90 echo $content;
91 // phpcs:ignoreEnd
92 ?>
93 </div>
94 <?php
95 /**
96 * Fires after the inner block content, before the closing fieldset.
97 * Used by pro to render hidden fields and map container.
98 *
99 * @param array<mixed> $attributes Block attributes.
100 * @param string $block_id Block ID.
101 * @since 2.8.0
102 */
103 do_action( 'srfm_address_after_fields', $this->attributes, $this->block_id );
104 ?>
105 </fieldset>
106 </div>
107 <?php
108 return ob_get_clean();
109 }
110 }
111