PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / trunk
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster vtrunk
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / elementor / modules / optin / fields / acceptance.php

acceptance.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/elementor/modules/optin/fields/acceptance.php

63 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || die();
4
5 class Sellkit_Elementor_Optin_Field_Acceptance extends Sellkit_Elementor_Optin_Field_Base {
6
7 public static function get_field_type() {
8 return 'acceptance';
9 }
10
11 public function get_input_type() {
12 return 'checkbox';
13 }
14
15 public function add_field_render_attribute() {
16 parent::add_field_render_attribute();
17
18 if ( 'true' === $this->field['checked_by_default'] ) {
19 $this->widget->add_render_attribute( 'field-' . $this->get_id(), 'checked' );
20 }
21 }
22
23 public function render_content() {
24 ?>
25 <div class="sellkit-field-subgroup">
26 <span class="sellkit-field-option sellkit-field-option-checkbox">
27 <input <?php echo $this->widget->get_render_attribute_string( 'field-' . esc_attr( $this->get_id() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor-generated attributes. ?>>
28 <label
29 for="optin-field-<?php echo esc_attr( $this->get_id() ); ?>"
30 class="sellkit-field-label">
31 <?php echo wp_kses_post( $this->field['acceptance_text'] ); ?>
32 <?php if ( isset( $this->field['required'] ) && 'true' === $this->field['required'] ) : ?>
33 <span class="required-mark-label"></span>
34 <?php endif ?>
35 </label>
36 </span>
37 </div>
38 <?php
39 }
40
41 public static function get_additional_controls() {
42 $commons = parent::get_common_controls();
43
44 return [
45 'label' => $commons['label'],
46 'acceptance_text' => [
47 'label' => esc_html__( 'Acceptance Text', 'sellkit' ),
48 'default' => esc_html__( 'I agree to terms.', 'sellkit' ),
49 'type' => 'textarea',
50 'conditions' => [ 'terms' => [ parent::get_type_condition() ] ],
51 ],
52 'checked_by_default' => [
53 'label' => esc_html__( 'Checked by Default', 'sellkit' ),
54 'type' => 'switcher',
55 'return_value' => 'true',
56 'conditions' => [ 'terms' => [ parent::get_type_condition() ] ],
57 ],
58 'required' => $commons['required'],
59 'width_responsive' => $commons['width_responsive'],
60 ];
61 }
62 }
63