| 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 |
?> |
| 17 |
<input <?php echo $this->widget->get_render_attribute_string( 'field-' . esc_attr( $this->get_id() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. ?>> |
| 18 |
<?php |
| 19 |
|
| 20 |
$attributes = [ |
| 21 |
'type' => 'hidden', |
| 22 |
'name' => 'fields[hidden_' . $this->get_id() . ']', |
| 23 |
'id' => 'optin-field-hidden-' . $this->get_id(), |
| 24 |
'class' => $this->get_class(), |
| 25 |
'data-type' => 'hidden', |
| 26 |
]; |
| 27 |
|
| 28 |
$this->widget->add_render_attribute( 'field-hidden-' . $this->get_id(), $attributes ); |
| 29 |
?> |
| 30 |
<input <?php echo $this->widget->get_render_attribute_string( 'field-hidden-' . $this->get_id() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. ?>> |
| 31 |
<?php |
| 32 |
} |
| 33 |
|
| 34 |
public static function get_additional_controls() { |
| 35 |
$commons = parent::get_common_controls(); |
| 36 |
|
| 37 |
$subtext1 = esc_html__( 'Set your google API key in ', 'sellkit' ); |
| 38 |
$subtext2 = esc_html__( 'Sellkit Settings ', 'sellkit' ); |
| 39 |
$setting_url = admin_url() . 'admin.php?page=sellkit-settings#/'; |
| 40 |
|
| 41 |
return [ |
| 42 |
'address_google_api_key_help' => [ |
| 43 |
'type' => 'raw_html', |
| 44 |
'conditions' => [ 'terms' => [ parent::get_type_condition() ] ], |
| 45 |
'raw' => sprintf( |
| 46 |
'<small>%1$s<a target="_blank" href="%2$s">%3$s<i class="fa fa-external-link-square"></i></a></small>.', |
| 47 |
$subtext1, |
| 48 |
$setting_url, |
| 49 |
$subtext2 |
| 50 |
), |
| 51 |
], |
| 52 |
'label' => $commons['label'], |
| 53 |
'field_value' => $commons['field_value'], |
| 54 |
'placeholder' => $commons['placeholder'], |
| 55 |
'required' => $commons['required'], |
| 56 |
'width_responsive' => $commons['width_responsive'], |
| 57 |
]; |
| 58 |
} |
| 59 |
} |
| 60 |
|