PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.12
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.12
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / models / fields / FrmFieldPhone.php

FrmFieldPhone.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.12, at classes/models/fields/FrmFieldPhone.php

92 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 /**
7 * @since 3.0
8 */
9 class FrmFieldPhone extends FrmFieldType {
10
11 /**
12 * @var string
13 * @since 3.0
14 */
15 protected $type = 'phone';
16
17 /**
18 * @var bool
19 * @since 3.0
20 */
21 protected $holds_email_values = true;
22
23 /**
24 * @var bool
25 */
26 protected $array_allowed = false;
27
28 /**
29 * @return bool[]
30 */
31 protected function field_settings_for_type() {
32 return array(
33 'size' => true,
34 'clear_on_focus' => true,
35 'invalid' => true,
36 );
37 }
38
39 /**
40 * @since 6.9
41 *
42 * @param array $args Includes 'field', 'display', and 'values'.
43 *
44 * @return void
45 */
46 public function show_primary_options( $args ) {
47 $field = $args['field'];
48
49 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/phone/phone-type.php';
50 FrmFieldsController::show_format_option( $field );
51
52 parent::show_primary_options( $args );
53 }
54
55 /**
56 * Retrieves the HTML for an 'International' option in a dropdown.
57 *
58 * @since 6.9
59 *
60 * @return void Outputs the HTML option tag directly.
61 */
62 protected function print_international_option() {
63 ?>
64 <option
65 value="international"
66 class="frm_show_upgrade frm_noallow"
67 data-upgrade="<?php esc_attr_e( 'International phone field', 'formidable' ); ?>"
68 data-medium="international-phone-field"
69 <?php selected( FrmField::get_option( $this->field, 'format' ), 'international' ); ?>
70 >
71 <?php esc_html_e( 'International', 'formidable' ); ?>
72 </option>
73 <?php
74 }
75
76 /**
77 * @return string
78 */
79 protected function html5_input_type() {
80 return 'tel';
81 }
82
83 /**
84 * @since 4.0.04
85 *
86 * @return void
87 */
88 public function sanitize_value( &$value ) {
89 FrmAppHelper::sanitize_value( 'sanitize_text_field', $value );
90 }
91 }
92