-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathfields-init.php
221 lines (182 loc) · 7.09 KB
/
fields-init.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?php
/**
* WooCommerce product data tab definition
*
* @return array
*/
add_action('wc_cpdf_init', 'prefix_custom_product_data_tab_init', 10, 0);
if(!function_exists('prefix_custom_product_data_tab_init')) :
function prefix_custom_product_data_tab_init(){
$custom_product_data_fields = array();
/** First product data tab starts **/
/** ===================================== */
$custom_product_data_fields['custom_data_1'] = array(
array(
'tab_name' => __('Custom Data 2sss', 'wc_cpdf'),
),
array(
'id' => '_mytext2',
'type' => 'text',
'label' => __('Text', 'wc_cpdf'),
'placeholder' => __('A placeholder text goes here.', 'wc_cpdf'),
'class' => 'large',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_mynumber2',
'type' => 'number',
'label' => __('Number', 'wc_cpdf'),
'placeholder' => __('Number.', 'wc_cpdf'),
'class' => 'short',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_mytextarea2',
'type' => 'textarea',
'label' => __('Textarea', 'wc_cpdf'),
'placeholder' => __('A placeholder text goes here.', 'wc_cpdf'),
'style' => 'width:70%;height:140px;',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_mycheckbox2',
'type' => 'checkbox',
'label' => __('Checkbox', 'wc_cpdf'),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_myselect2',
'type' => 'select',
'label' => __('Select', 'wc_cpdf'),
'options' => array(
'option_1' => 'Option 1',
'option_2' => 'Option 2',
'option_3' => 'Option 3'
),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_myradio2',
'type' => 'radio',
'label' => __('Radio', 'wc_cpdf'),
'options' => array(
'radio_1' => 'Radio 1',
'radio_2' => 'Radio 2',
'radio_3' => 'Radio 3'
),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_myhidden2',
'type' => 'hidden',
'value' => 'Hidden Value',
),
// New field type goes here
// Multiselect
array(
'id' => '_mymultiselect22',
'type' => 'multiselect',
'label' => __('Multiselect', 'wc_cpdf'),
'placeholder' => __('Multiselect maan!', 'wc_cpdf'),
'options' => array(
'option_1' => 'Option 1',
'option_2' => 'Option 2',
'option_3' => 'Option 3',
'option_4' => 'Option 4',
'option_5' => 'Option 5'
),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
'class' => 'medium'
),
// image
array(
'id' => '_myimage_12',
'type' => 'image',
'label' => __('Image 1', 'wc_cpdf'),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_myimage_22',
'type' => 'image',
'label' => __('Image 2', 'wc_cpdf'),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_mygallery2',
'type' => 'gallery',
'label' => __('Gallery', 'wc_cpdf'),
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
// Color
array(
'id' => '_mycolor2',
'type' => 'color',
'label' => __('Select color', 'wc_cpdf'),
'placeholder' => __('A placeholder text goes here.', 'wc_cpdf'),
'class' => 'large',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'id' => '_mycolor22',
'type' => 'color',
'label' => __('Select color 2', 'wc_cpdf'),
'placeholder' => __('A placeholder text goes here.', 'wc_cpdf'),
'class' => 'large',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
// Datepicker
array(
'id' => '_mydatepicker2',
'type' => 'datepicker',
'label' => __('Select date', 'wc_cpdf'),
'placeholder' => __('A placeholder text goes here.', 'wc_cpdf'),
'class' => 'large',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
),
array(
'type' => 'divider'
),
array(
'id' => '_mydatepicker22',
'type' => 'datepicker',
'label' => __('Select date 2', 'wc_cpdf'),
'placeholder' => __('A placeholder text goes here.', 'wc_cpdf'),
'class' => 'large',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
)
);
/** First product data tab ends **/
/** ===================================== */
/** Second product data tab starts **/
/** ===================================== */
$custom_product_data_fields['custom_data_2'] = array(
array(
'tab_name' => __('Custom Data ABC', 'wc_cpdf'),
),
array(
'id' => '_mytext_abcd',
'type' => 'text',
'label' => __('Text ABCD', 'wc_cpdf'),
'placeholder' => __('A placeholder text goes here.', 'wc_cpdf'),
'class' => 'large',
'description' => __('Field description.', 'wc_cpdf'),
'desc_tip' => true,
)
);
return $custom_product_data_fields;
}
endif;