Control_Base_Multiple()
Elementor control base multiple.
Description
An abstract class for creating new controls in the panel that return more than a single value. Each value of the multi-value control will be returned as an item in a key => value
array.
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |
Methods
- get_default_value — Get multiple control default value.
- get_style_value — Get multiple control style value.
- get_value — Get multiple control value.
Source
includes/controls/base-multiple.php
abstract class Control_Base_Multiple extends Base_Data_Control { public function get_default_value() { return []; } public function get_value( $control, $widget ) { $value = parent::get_value( $control, $widget ); if ( empty( $control['default'] ) ) { $control['default'] = []; } if ( ! is_array( $value ) ) { $value = []; } $control['default'] = array_merge( $this->get_default_value(), $control['default'] ); return array_merge( $control['default'], $value ); } public function get_style_value( $css_property, $control_value ) { return $control_value[ $css_property ]; } }