| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || die(); |
| 4 |
|
| 5 |
class Sellkit_Elementor_Optin_Field_Textarea extends Sellkit_Elementor_Optin_Field_Base { |
| 6 |
|
| 7 |
public static function get_field_type() { |
| 8 |
return 'textarea'; |
| 9 |
} |
| 10 |
|
| 11 |
public function get_input_type() { |
| 12 |
return 'textarea'; |
| 13 |
} |
| 14 |
|
| 15 |
public function add_field_render_attribute() { |
| 16 |
parent::add_field_render_attribute(); |
| 17 |
|
| 18 |
$this->widget->add_render_attribute( 'field-' . $this->get_id(), 'rows', $this->field['rows'] ); |
| 19 |
} |
| 20 |
|
| 21 |
public function render_content() { |
| 22 |
?> |
| 23 |
<textarea <?php echo $this->widget->get_render_attribute_string( 'field-' . esc_attr( $this->get_id() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. ?>><?php echo wp_kses_post( $this->field['field_value'] ); ?></textarea> |
| 24 |
<?php |
| 25 |
} |
| 26 |
|
| 27 |
public static function get_additional_controls() { |
| 28 |
$commons = parent::get_common_controls(); |
| 29 |
|
| 30 |
return [ |
| 31 |
'label' => $commons['label'], |
| 32 |
'field_value' => $commons['field_value'], |
| 33 |
'rows' => [ |
| 34 |
'label' => esc_html__( 'Rows', 'sellkit' ), |
| 35 |
'type' => 'number', |
| 36 |
'default' => 5, |
| 37 |
'conditions' => [ 'terms' => [ parent::get_type_condition() ] ], |
| 38 |
], |
| 39 |
'required' => $commons['required'], |
| 40 |
'width_responsive' => $commons['width_responsive'], |
| 41 |
]; |
| 42 |
} |
| 43 |
} |
| 44 |
|