| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - die( 'You are not allowed to call this page directly.' ); | |
| 4 | -} | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * @since 3.0 |
| 8 | 5 | */ |
| @@ -12,22 +9,10 @@ | ||
| 12 | 9 | * @var string |
| 13 | 10 | * @since 3.0 |
| 14 | 11 | */ |
| 15 | 12 | protected $type = 'url'; |
| 16 | - | |
| 17 | - /** | |
| 18 | - * @var string | |
| 19 | - */ | |
| 20 | 13 | protected $display_type = 'text'; |
| 21 | 14 | |
| 22 | - /** | |
| 23 | - * @var bool | |
| 24 | - */ | |
| 25 | - protected $array_allowed = false; | |
| 26 | - | |
| 27 | - /** | |
| 28 | - * @return bool[] | |
| 29 | - */ | |
| 30 | 15 | protected function field_settings_for_type() { |
| 31 | 16 | return array( |
| 32 | 17 | 'size' => true, |
| 33 | 18 | 'clear_on_focus' => true, |
| @@ -44,24 +29,18 @@ | ||
| 44 | 29 | 'show_image' => 0, |
| 45 | 30 | ); |
| 46 | 31 | } |
| 47 | 32 | |
| 48 | - /** | |
| 49 | - * @return string | |
| 50 | - */ | |
| 51 | 33 | protected function get_field_name() { |
| 52 | 34 | return __( 'Website', 'formidable' ); |
| 53 | 35 | } |
| 54 | 36 | |
| 55 | - /** | |
| 56 | - * @return void | |
| 57 | - */ | |
| 58 | 37 | protected function fill_default_atts( &$atts ) { |
| 59 | 38 | $defaults = array( |
| 60 | - 'sep' => ', ', | |
| 39 | + 'sep' => ', ', | |
| 61 | 40 | 'html' => false, |
| 62 | 41 | ); |
| 63 | - $atts = wp_parse_args( $atts, $defaults ); | |
| 42 | + $atts = wp_parse_args( $atts, $defaults ); | |
| 64 | 43 | |
| 65 | 44 | if ( $atts['html'] ) { |
| 66 | 45 | $atts['sep'] = ' '; |
| 67 | 46 | } |
| @@ -94,9 +73,9 @@ | ||
| 94 | 73 | if ( $atts['html'] ) { |
| 95 | 74 | $images = ''; |
| 96 | 75 | foreach ( (array) $value as $url ) { |
| 97 | 76 | $image_regex = '/(\.(?i)(jpg|jpeg|png|gif))$/'; |
| 98 | - $is_image = preg_match( $image_regex, $url ); | |
| 77 | + $is_image = preg_match( $image_regex, $url ); | |
| 99 | 78 | if ( $is_image ) { |
| 100 | 79 | $images .= '<img src="' . esc_attr( $url ) . '" class="frm_image_from_url" alt="" /> '; |
| 101 | 80 | } else { |
| 102 | 81 | $images .= strip_tags( $url ); |
| @@ -105,15 +84,6 @@ | ||
| 105 | 84 | $value = $images; |
| 106 | 85 | } |
| 107 | 86 | |
| 108 | 87 | return $value; |
| 109 | - } | |
| 110 | - | |
| 111 | - /** | |
| 112 | - * @since 4.0.04 | |
| 113 | - * | |
| 114 | - * @return void | |
| 115 | - */ | |
| 116 | - public function sanitize_value( &$value ) { | |
| 117 | - FrmAppHelper::sanitize_value( 'esc_url_raw', $value ); | |
| 118 | 88 | } |
| 119 | 89 | } |