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 / actions / utils / action-base.php

action-base.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/elementor/modules/optin/actions/utils/action-base.php

88 lines 1.7 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 use Sellkit_Elementor_Optin_Ajaxhandler as AjaxHandler;
6
7 /**
8 * An abstract class to register new optin action.
9 *
10 * @since 1.5.0
11 * @abstract
12 */
13 abstract class Sellkit_Elementor_Optin_Action_Base {
14
15 /**
16 * Initializes action base for Optin widget.
17 *
18 * @since 1.5.0
19 */
20 public function __construct() {
21 add_action( 'elementor/element/sellkit-optin/section_settings/after_section_end', [ $this, 'add_action_section_controls' ] );
22 }
23
24 /**
25 * Get name of this action.
26 *
27 * @since 1.5.0
28 * @access public
29 * @abstract
30 */
31 abstract public function get_name();
32
33 /**
34 * Get title of this action.
35 *
36 * @since 1.5.0
37 * @access public
38 * @abstract
39 */
40 abstract public function get_title();
41
42 /**
43 * Called by hook, and injects controls section relating to this action.
44 *
45 * @param object $widget widget instance passed by hook.
46 * @since 1.5.0
47 * @access public
48 */
49 public function add_action_section_controls( $widget ) {
50 $action = $this->get_name();
51
52 $widget->start_controls_section( "section_{$action}",
53 [
54 'label' => $this->get_title(),
55 'condition' => [ 'crm_actions' => $action ],
56 ]
57 );
58
59 $this->add_controls( $widget );
60
61 $widget->end_controls_section();
62 }
63
64 /**
65 * Add action controls.
66 *
67 * @param object $widget instance.
68 * @return void
69 *
70 * @since 1.5.0
71 * @access public
72 * @abstract
73 */
74 abstract public function add_controls( $widget );
75
76 /**
77 * Run the main functionality of the action.
78 *
79 * @param AjaxHandler $ajax_handler Ajax handler instance.
80 *
81 * @since 1.5.0
82 * @access public
83 * @abstract
84 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
85 */
86 public function run( AjaxHandler $ajax_handler ) {}
87 }
88