PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / templates / form-fields / url.php

url.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at templates/form-fields/url.php

54 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 /**
9 * The template used to display text form fields.
10 *
11 * @author WP Charitable LLC
12 * @package Charitable/Templates/Form Fields
13 * @since 1.0.0
14 * @version 1.6.44
15 * @version 1.8.8.6
16 */
17
18 if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) {
19 return;
20 }
21
22 $charitable_form = $view_args['form'];
23 $charitable_field = $view_args['field'];
24 $charitable_classes = esc_attr( $view_args['classes'] );
25 $charitable_is_required = isset( $charitable_field['required'] ) ? $charitable_field['required'] : false;
26 $charitable_value = isset( $charitable_field['value'] ) ? $charitable_field['value'] : '';
27
28 /* Set the default pattern */
29 if ( ! isset( $charitable_field['attrs']['pattern'] ) ) {
30 $charitable_field['attrs']['pattern'] = 'https?://.+';
31 }
32
33 /* Set the default onblur attribute */
34 if ( ! isset( $charitable_field['attrs']['onblur'] ) ) {
35 $charitable_field['attrs']['onblur'] = 'CHARITABLE.SanitizeURL(this)';
36 }
37
38 if ( ! wp_script_is( 'charitable-url-sanitizer', 'enqueued' ) ) {
39 wp_enqueue_script( 'charitable-url-sanitizer' );
40 }
41
42 ?>
43 <div id="charitable_field_<?php echo esc_attr( $charitable_field['key'] ); ?>" class="<?php echo esc_attr( $charitable_classes ); ?>">
44 <?php if ( isset( $charitable_field['label'] ) ) : ?>
45 <label for="charitable_field_<?php echo esc_attr( $charitable_field['key'] ); ?>_element">
46 <?php echo wp_kses_post( $charitable_field['label'] ); ?>
47 <?php if ( $charitable_is_required ) : ?>
48 <abbr class="required" title="<?php esc_html_e( 'Required', 'charitable' ); ?>">*</abbr>
49 <?php endif ?>
50 </label>
51 <?php endif ?>
52 <input type="url" name="<?php echo esc_attr( $charitable_field['key'] ); ?>" id="charitable_field_<?php echo esc_attr( $charitable_field['key'] ); ?>_element" value="<?php echo esc_attr( stripslashes( $charitable_value ) ); ?>" <?php echo charitable_get_arbitrary_attributes( $charitable_field ); // phpcs:ignore ?>/>
53 </div>
54