-
Notifications
You must be signed in to change notification settings - Fork 0
/
unyson-multi-select.sublime-snippet
54 lines (54 loc) · 1.67 KB
/
unyson-multi-select.sublime-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<snippet>
<content><![CDATA[
'${1:option_id}' => array(
'type' => 'multi-select',
'value' => array( ${2:'choice-1', 'choice-2'} ),
'attr' => array( ${3:'class' => 'custom-class', 'data-foo' => 'bar'} ),
'label' => __('${4:Label}', 'fw'),
'desc' => __('${5:Description}', 'fw'),
'help' => __('${6:Help tip}', 'fw'),
/**
* Set population method
* Are available: 'posts', 'taxonomy', 'users', 'array'
*/
'population' => '${7:array}',
/**
* Set post types, taxonomies, user roles to search for
*
* 'population' => 'posts'
* 'source' => 'page',
*
* 'population' => 'taxonomy'
* 'source' => 'category',
*
* 'population' => 'users'
* 'source' => array( 'editor', 'subscriber', 'author' ),
*
* 'population' => 'array'
* 'source' => '' // will populate with 'choices' array
*/
'source' => '$8',
/**
* Set the number of posts/users/taxonomies that multi-select will be prepopulated
* Or set the value to false in order to disable this functionality.
*/
'prepopulation' => ${9:10},
/**
* An array with the available choices
* Used only when 'population' => 'array'
*/
'choices' => array(
${10:'choice-1' => __('Choice 1', 'fw'),
'choice-2' => __('Choice 2', 'fw'),}
),
/**
* Set maximum items number that can be selected
*/
'limit' => ${11:100},
), // ${1:option_id}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>unyson-multi-select</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>