Skip to content

Commit 4ccb3f1

Browse files
Docs: Document Select Control groups argument (#291)
1 parent 2f9f3ed commit 4ccb3f1

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

src/editor-controls/control-select.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ When using this control, the `type` should be set to `\Elementor\Controls_Manage
6464
<td></td>
6565
<td>An array of <code>key =&gt; value</code> pairs: <code>[ 'key' =&gt; 'value', ... ]</code></td>
6666
</tr>
67+
<tr>
68+
<td><code>groups</code></td>
69+
<td><code>array</code></td>
70+
<td></td>
71+
<td>An array of grouped options.</td>
72+
</tr>
6773
<tr>
6874
<td><code>default</code></td>
6975
<td><code>string</code></td>
@@ -79,7 +85,7 @@ When using this control, the `type` should be set to `\Elementor\Controls_Manage
7985

8086
## Usage
8187

82-
```php {14-32,41-43,49-51}
88+
```php {14-32,34-67,76-78,84-86}
8389
<?php
8490
class Elementor_Test_Widget extends \Elementor\Widget_Base {
8591

@@ -113,6 +119,41 @@ class Elementor_Test_Widget extends \Elementor\Widget_Base {
113119
]
114120
);
115121

122+
$this->add_control(
123+
'custom_animation',
124+
[
125+
'label' => esc_html__( 'Animation', 'textdomain' ),
126+
'type' => Controls_Manager::SELECT,
127+
'groups' => [
128+
[
129+
'label' => esc_html__( 'None', 'textdomain' ),
130+
'options' => [
131+
'' => esc_html__( 'None', 'textdomain' ),
132+
],
133+
],
134+
[
135+
'label' => esc_html__( 'Slide', 'textdomain' ),
136+
'options' => [
137+
'slide-from-right' => esc_html__( 'Slide In Right', 'textdomain' ),
138+
'slide-from-left' => esc_html__( 'Slide In Left', 'textdomain' ),
139+
'slide-from-top' => esc_html__( 'Slide In Up', 'textdomain' ),
140+
'slide-from-bottom' => esc_html__( 'Slide In Down', 'textdomain' ),
141+
],
142+
],
143+
[
144+
'label' => esc_html__( 'Zoom', 'textdomain' ),
145+
'options' => [
146+
'grow' => esc_html__( 'Grow', 'textdomain' ),
147+
'shrink' => esc_html__( 'Shrink', 'textdomain' ),
148+
'zoom-in' => esc_html__( 'Zoom In', 'textdomain' ),
149+
'zoom-out' => esc_html__( 'Zoom Out', 'textdomain' ),
150+
],
151+
],
152+
],
153+
'prefix_class' => 'custom-animation-',
154+
]
155+
);
156+
116157
$this->end_controls_section();
117158

118159
}

0 commit comments

Comments
 (0)