use Elementor\Core\Base\Base_Object;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
* Elementor base control.
* An abstract class for creating new controls in the panel.
abstract class Base_Control extends Base_Object {
* Holds all the base settings of the control.
private $_base_settings = [
'separator' => 'default',
* Retrieve the list of all the available features. Currently Elementor uses only
* @return array Features array.
public static function get_features() {
* Retrieve the control type.
abstract public function get_type();
* Control base constructor.
* Initializing the control base class.
public function __construct() {
$this->set_settings( array_merge( $this->_base_settings, $this->get_default_settings() ) );
$this->set_settings( 'features', static::get_features() );
* Enqueue control scripts and styles.
* Used to register and enqueue custom scripts and styles used by the control.
public function enqueue() {}
* Control content template.
* Used to generate the control HTML in the editor using Underscore JS
* template. The variables for the class are available using `data` JS
* Note that the content template is wrapped by Base_Control::print_template().
abstract public function content_template();
* Print control template.
* Used to generate the control HTML in the editor using Underscore JS
* template. The variables for the class are available using `data` JS
final public function print_template() {
<script type="text/html" id="tmpl-elementor-control-<?php echo esc_attr( $this->get_type() ); ?>-content">
<div class="elementor-control-content">
$this->content_template();
* Get default control settings.
* Retrieve the default settings of the control. Used to return the default
* settings while initializing the control.
* @return array Control default settings.
protected function get_default_settings() {
public static function get_assets( $setting ) {
* Update value of control that needs to be updated after import.
* @param array $control_args
public function on_import_update_settings( $value, array $control_args, array $config ) {