@@ -43,6 +43,14 @@ class Kirki_Control_Multicolor extends WP_Customize_Control {
43
43
*/
44
44
public $ option_type = 'theme_mod ' ;
45
45
46
+ /**
47
+ * Enable/Disable Alpha channel on color pickers
48
+ *
49
+ * @access public
50
+ * @var boolean
51
+ */
52
+ public $ alpha = true ;
53
+
46
54
/**
47
55
* Constructor.
48
56
*
@@ -72,6 +80,7 @@ class Kirki_Control_Multicolor extends WP_Customize_Control {
72
80
* @type array $choices List of choices for 'radio' or 'select' type controls, where
73
81
* values are the keys, and labels are the values.
74
82
* Default empty array.
83
+ * @type boolean $alpha Enables/Disables alpha channel on color pickers
75
84
* @type array $input_attrs List of custom input attributes for control output, where
76
85
* attribute names are the keys and values are the values. Not
77
86
* used for 'checkbox', 'radio', 'select', 'textarea', or
@@ -129,6 +138,7 @@ public function to_json() {
129
138
$ this ->json ['choices ' ] = $ this ->choices ;
130
139
$ this ->json ['link ' ] = $ this ->get_link ();
131
140
$ this ->json ['id ' ] = $ this ->id ;
141
+ $ this ->json ['alpha ' ] = $ this ->alpha ;
132
142
133
143
$ this ->json ['inputAttrs ' ] = '' ;
134
144
foreach ( $ this ->input_attrs as $ attr => $ value ) {
@@ -162,7 +172,7 @@ protected function content_template() {
162
172
<# if ( data.choices[ key ] ) { #>
163
173
<label for="{{ data.id }}-{{ key }}">{{ data.choices[ key ] }}</label>
164
174
<# } #>
165
- <input {{{ data.inputAttrs }}} id="{{ data.id }}-{{ key }}" type="text" data-palette="{{ data.palette }}" data-default-color="{{ data.default[ key ] }}" data-alpha="true " value="{{ data.value[ key ] }}" class="kirki-color-control color-picker multicolor-index-{{ key }}" />
175
+ <input {{{ data.inputAttrs }}} id="{{ data.id }}-{{ key }}" type="text" data-palette="{{ data.palette }}" data-default-color="{{ data.default[ key ] }}" data-alpha="{{ data.alpha }} " value="{{ data.value[ key ] }}" class="kirki-color-control color-picker multicolor-index-{{ key }}" />
166
176
</div>
167
177
<# } #>
168
178
<# } #>
0 commit comments