| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || die(); |
| 4 |
|
| 5 |
class Sellkit_Elementor_Optin_Field_Address extends Sellkit_Elementor_Optin_Field_Base { |
| 6 |
|
| 7 |
public static function get_field_type() { |
| 8 |
return 'address'; |
| 9 |
} |
| 10 |
|
| 11 |
public function get_input_type() { |
| 12 |
return 'text'; |
| 13 |
} |
| 14 |
|
| 15 |
public function render_content() { |
| 16 |
$attrs = $this->widget->get_render_attribute_string( 'field-' . $this->get_id() ); |
| 17 |
|
| 18 |
?> |
| 19 |
<input <?php echo $attrs; ?>> |
| 20 |
<?php |
| 21 |
} |
| 22 |
|
| 23 |
public static function get_additional_controls() { |
| 24 |
$commons = parent::get_common_controls(); |
| 25 |
|
| 26 |
$subtext1 = esc_html__( 'Set your google API key in ', 'sellkit' ); |
| 27 |
$subtext2 = esc_html__( 'Sellkit Settings ', 'sellkit' ); |
| 28 |
$setting_url = admin_url() . 'admin.php?page=sellkit-settings#/'; |
| 29 |
|
| 30 |
return [ |
| 31 |
'address_google_api_key_help' => [ |
| 32 |
'type' => 'raw_html', |
| 33 |
'conditions' => [ 'terms' => [ parent::get_type_condition() ] ], |
| 34 |
'raw' => sprintf( |
| 35 |
'<small>%1$s<a target="_blank" href="%2$s">%3$s<i class="fa fa-external-link-square"></i></a></small>.', |
| 36 |
$subtext1, |
| 37 |
$setting_url, |
| 38 |
$subtext2 |
| 39 |
), |
| 40 |
], |
| 41 |
'label' => $commons['label'], |
| 42 |
'field_value' => $commons['field_value'], |
| 43 |
'placeholder' => $commons['placeholder'], |
| 44 |
'required' => $commons['required'], |
| 45 |
'width_responsive' => $commons['width_responsive'], |
| 46 |
]; |
| 47 |
} |
| 48 |
} |
| 49 |
|