| 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 |
protected $display_type = 'text'; |
| 17 |
|
| 18 |
/** |
| 19 |
* @var bool |
| 20 |
* @since 3.0 |
| 21 |
*/ |
| 22 |
protected $holds_email_values = true; |
| 23 |
|
| 24 |
protected function field_settings_for_type() { |
| 25 |
return array( |
| 26 |
'size' => true, |
| 27 |
'clear_on_focus' => true, |
| 28 |
'invalid' => true, |
| 29 |
'format' => true, |
| 30 |
); |
| 31 |
} |
| 32 |
|
| 33 |
protected function html5_input_type() { |
| 34 |
$frm_settings = FrmAppHelper::get_settings(); |
| 35 |
|
| 36 |
return $frm_settings->use_html ? 'tel' : 'text'; |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* @since 4.0.04 |
| 41 |
*/ |
| 42 |
public function sanitize_value( &$value ) { |
| 43 |
FrmAppHelper::sanitize_value( 'sanitize_text_field', $value ); |
| 44 |
} |
| 45 |
} |
| 46 |
|