PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.1
Elementor Website Builder – more than just a page builder v3.0.1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / controls / color.php

color.php in Elementor Website Builder – more than just a page builder 3.0.1, at includes/controls/color.php

84 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 use Elementor\Modules\DynamicTags\Module as TagsModule;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * Elementor color control.
12 *
13 * A base control for creating color control. Displays a color picker field with
14 * an alpha slider. Includes a customizable color palette that can be preset by
15 * the user. Accepts a `scheme` argument that allows you to set a value from the
16 * active color scheme as the default value returned by the control.
17 *
18 * @since 1.0.0
19 */
20 class Control_Color extends Base_Data_Control {
21
22 /**
23 * Get color control type.
24 *
25 * Retrieve the control type, in this case `color`.
26 *
27 * @since 1.0.0
28 * @access public
29 *
30 * @return string Control type.
31 */
32 public function get_type() {
33 return 'color';
34 }
35
36 /**
37 * Render color control output in the editor.
38 *
39 * Used to generate the control HTML in the editor using Underscore JS
40 * template. The variables for the class are available using `data` JS
41 * object.
42 *
43 * @since 1.0.0
44 * @access public
45 */
46 public function content_template() {
47 ?>
48 <div class="elementor-control-field">
49 <label class="elementor-control-title">{{{ data.label || '' }}}</label>
50 <div class="elementor-control-input-wrapper elementor-control-dynamic-switcher-wrapper elementor-control-unit-5">
51 <div class="elementor-color-picker-placeholder"></div>
52 </div>
53 </div>
54 <?php
55 }
56
57 /**
58 * Get color control default settings.
59 *
60 * Retrieve the default settings of the color control. Used to return the default
61 * settings while initializing the color control.
62 *
63 * @since 1.0.0
64 * @access protected
65 *
66 * @return array Control default settings.
67 */
68 protected function get_default_settings() {
69 return [
70 'alpha' => true,
71 'scheme' => '',
72 'dynamic' => [
73 'categories' => [
74 TagsModule::COLOR_CATEGORY,
75 ],
76 'active' => true,
77 ],
78 'global' => [
79 'active' => true,
80 ],
81 ];
82 }
83 }
84