PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 0.0.13
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v0.0.13
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 0.0.2 All 97 releases
sureforms / inc / fields / url-markup.php

url-markup.php in SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz 0.0.13, at inc/fields/url-markup.php

65 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Sureforms Url 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 Url Field Markup Class.
17 *
18 * @since 0.0.1
19 */
20 class Url_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->slug = 'url';
29 $this->set_properties( $attributes );
30 $this->set_input_label( __( 'Url', 'sureforms' ) );
31 $this->set_error_msg( $attributes, 'srfm_url_block_required_text' );
32 $this->set_unique_slug();
33 $this->set_field_name( $this->unique_slug );
34 $this->set_markup_properties( $this->input_label, true );
35 $this->set_aria_described_by();
36 $this->set_label_as_placeholder( $this->input_label );
37 }
38
39 /**
40 * Render the sureforms url classic styling
41 *
42 * @since 0.0.2
43 * @return string|boolean
44 */
45 public function markup() {
46 ob_start(); ?>
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<?php echo esc_attr( $this->block_width ); ?><?php echo esc_attr( $this->class_name ); ?> <?php echo esc_attr( $this->conditional_class ); ?>">
48 <?php echo wp_kses_post( $this->label_markup ); ?>
49 <?php echo wp_kses_post( $this->help_markup ); ?>
50 <div class="srfm-block-wrap">
51 <input class="srfm-input-common srfm-input-<?php echo esc_attr( $this->slug ); ?>" type="text" name="<?php echo esc_attr( $this->field_name ); ?>" id="<?php echo esc_attr( $this->unique_slug ); ?>"
52 <?php echo ! empty( $this->aria_described_by ) ? "aria-describedby='" . esc_attr( trim( $this->aria_described_by ) ) . "'" : ''; ?>
53 aria-required="<?php echo esc_attr( $this->aria_require_attr ); ?>" <?php echo wp_kses_post( $this->default_value_attr ); ?> <?php echo wp_kses_post( $this->placeholder_attr ); ?>/>
54 <?php echo $this->error_svg; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Ignored to render svg ?>
55 </div>
56 <div class="srfm-error-wrap">
57 <?php echo wp_kses_post( $this->error_msg_markup ); ?>
58 </div>
59 </div>
60 <?php
61 return ob_get_clean();
62 }
63 }
64
65