PluginProbe ʕ •ᴥ•ʔ
SureForms – Drag & Drop Contact Form & Form Builder, Payment Form, Survey, Quiz & Calculator / 2.12.1
SureForms – Drag & Drop Contact Form & Form Builder, Payment Form, Survey, Quiz & Calculator 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 / url-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
url-markup.php
72 lines
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 * Read-only attribute for the URL field.
23 *
24 * @var bool
25 * @since 1.7.2
26 */
27 protected $read_only;
28
29 /**
30 * Initialize the properties based on block attributes.
31 *
32 * @param array<mixed> $attributes Block attributes.
33 * @since 0.0.2
34 */
35 public function __construct( $attributes ) {
36 $this->slug = 'url';
37 $this->set_properties( $attributes );
38 $this->set_input_label( __( 'URL', 'sureforms' ) );
39 $this->set_error_msg( $attributes, 'srfm_url_block_required_text' );
40 $this->read_only = ! empty( trim( $this->default ) ) && $attributes['readOnly'];
41 $this->set_unique_slug();
42 $this->set_field_name( $this->unique_slug );
43 $this->set_markup_properties( $this->input_label, true );
44 $this->set_aria_described_by();
45 $this->set_label_as_placeholder( $this->input_label );
46 }
47
48 /**
49 * Render the sureforms url classic styling
50 *
51 * @since 0.0.2
52 * @return string|bool
53 */
54 public function markup() {
55 ob_start(); ?>
56 <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 ); ?><?php echo esc_attr( $this->read_only ? ' srfm-read-only' : '' ); ?>">
57 <?php echo wp_kses_post( $this->label_markup ); ?>
58 <?php echo wp_kses_post( $this->help_markup ); ?>
59 <div class="srfm-block-wrap">
60 <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 ); ?>"
61 <?php echo ! empty( $this->aria_described_by ) ? "aria-describedby='" . esc_attr( trim( $this->aria_described_by ) ) . "'" : ''; ?>
62 data-required="<?php echo esc_attr( $this->data_require_attr ); ?>" aria-required="<?php echo esc_attr( $this->data_require_attr ); ?>" value="<?php echo esc_attr( $this->default ); ?>" <?php echo wp_kses_post( $this->placeholder_attr ); ?> <?php echo $this->read_only ? 'readonly' : ''; ?> />
63 </div>
64 <div class="srfm-error-wrap">
65 <?php echo wp_kses_post( $this->error_msg_markup ); ?>
66 </div>
67 </div>
68 <?php
69 return ob_get_clean();
70 }
71 }
72