PluginProbe
Cool Timeline (Horizontal & Vertical Timeline) / trunk
Cool Timeline (Horizontal & Vertical Timeline) vtrunk
3.4.0 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 2.2.3 2.3.3 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.6.1 2.7.1 2.8.3 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 All 79 releases
cool-timeline / admin / codestar-framework / samples / admin-options.php

admin-options.php in Cool Timeline (Horizontal & Vertical Timeline) trunk, at admin/codestar-framework/samples/admin-options.php

3,815 lines 101.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2
3 //
4 // Set a unique slug-like ID
5 //
6 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
7 $prefix = '_prefix_my_options';
8
9 //
10 // Create options
11 //
12 CSF::createOptions( $prefix, array(
13 'menu_title' => 'CSF Demo',
14 'menu_slug' => 'csf-demo',
15 ) );
16
17 //
18 // Create a section
19 //
20 CSF::createSection( $prefix, array(
21 'title' => 'Overview',
22 'icon' => 'fas fa-rocket',
23 'fields' => array(
24
25 //
26 // A text field
27 //
28 array(
29 'id' => 'opt-text',
30 'type' => 'text',
31 'title' => 'Text',
32 ),
33
34 array(
35 'id' => 'opt-textarea',
36 'type' => 'textarea',
37 'title' => 'Textarea',
38 'help' => 'The help text of the field.',
39 ),
40
41 array(
42 'id' => 'opt-upload',
43 'type' => 'upload',
44 'title' => 'Upload',
45 ),
46
47 array(
48 'id' => 'opt-switcher',
49 'type' => 'switcher',
50 'title' => 'Switcher',
51 'label' => 'The label text of the switcher.',
52 ),
53
54 array(
55 'id' => 'opt-color',
56 'type' => 'color',
57 'title' => 'Color',
58 'default' => '#3498db',
59 ),
60
61 array(
62 'id' => 'opt-checkbox',
63 'type' => 'checkbox',
64 'title' => 'Checkbox',
65 'label' => 'The label text of the checkbox.',
66 ),
67
68 array(
69 'id' => 'opt-radio',
70 'type' => 'radio',
71 'title' => 'Radio',
72 'options' => array(
73 'yes' => 'Yes, Please.',
74 'no' => 'No, Thank you.',
75 ),
76 'default' => 'yes',
77 ),
78
79 array(
80 'id' => 'opt-select',
81 'type' => 'select',
82 'title' => 'Select',
83 'placeholder' => 'Select an option',
84 'options' => array(
85 'opt-1' => 'Option 1',
86 'opt-2' => 'Option 2',
87 'opt-3' => 'Option 3',
88 ),
89 ),
90
91 array(
92 'id' => 'opt-image-select',
93 'type' => 'image_select',
94 'title' => 'Image Select',
95 'options' => array(
96 'opt-1' => 'http://codestarframework.com/assets/images/placeholder/100x80-2ecc71.gif',
97 'opt-2' => 'http://codestarframework.com/assets/images/placeholder/100x80-e74c3c.gif',
98 'opt-3' => 'http://codestarframework.com/assets/images/placeholder/100x80-ffbc00.gif',
99 'opt-4' => 'http://codestarframework.com/assets/images/placeholder/100x80-3498db.gif',
100 'opt-5' => 'http://codestarframework.com/assets/images/placeholder/100x80-555555.gif',
101 ),
102 'default' => 'opt-1',
103 ),
104
105 array(
106 'id' => 'opt-background',
107 'type' => 'background',
108 'title' => 'Background',
109 ),
110
111 array(
112 'type' => 'notice',
113 'style' => 'success',
114 'content' => 'A <strong>notice</strong> field with <strong>success</strong> style.',
115 ),
116
117 array(
118 'id' => 'opt-icon',
119 'type' => 'icon',
120 'title' => 'Icon',
121 ),
122
123 array(
124 'id' => 'opt-alt-text',
125 'type' => 'text',
126 'title' => 'Text',
127 ),
128
129 array(
130 'id' => 'opt-alt-textarea',
131 'type' => 'textarea',
132 'title' => 'Textarea',
133 'subtitle' => 'A textarea with shortcoder.',
134 'shortcoder' => 'csf_demo_shortcodes',
135 ),
136
137 )
138 ) );
139
140 //
141 // Basic Fields
142 //
143 CSF::createSection( $prefix, array(
144 'id' => 'basic_fields',
145 'title' => 'Basic Fields',
146 'icon' => 'fas fa-plus-circle',
147 ) );
148
149 //
150 // Field: text
151 //
152 CSF::createSection( $prefix, array(
153 'parent' => 'basic_fields',
154 'title' => 'Text',
155 'icon' => 'far fa-square',
156 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=text" target="_blank">Field: text</a>',
157 'fields' => array(
158
159 array(
160 'id' => 'opt-text-1',
161 'type' => 'text',
162 'title' => 'Text',
163 ),
164
165 array(
166 'id' => 'opt-text-2',
167 'type' => 'text',
168 'title' => 'Text with default',
169 'default' => 'This is default value bla bla bla',
170 ),
171
172 array(
173 'id' => 'opt-text-3',
174 'type' => 'text',
175 'title' => 'Text field ingenuity',
176 'subtitle' => 'The field of subtitle text.',
177 'help' => 'The field of help text.',
178 'before' => '<p>The field of before text.</p>',
179 'after' => '<p>The field of after text.</p>',
180 ),
181
182 array(
183 'id' => 'opt-text-4',
184 'type' => 'text',
185 'title' => 'Text with placeholder',
186 'placeholder' => 'Typed something...'
187 ),
188
189 array(
190 'id' => 'opt-text-5',
191 'type' => 'text',
192 'title' => 'Text readonly',
193 'attributes' => array(
194 'readonly' => 'readonly'
195 ),
196 'default' => 'readonly text field, can not be changed'
197 ),
198
199 array(
200 'id' => 'opt-text-6',
201 'type' => 'text',
202 'title' => 'Text with maxlength (5)',
203 'attributes' => array(
204 'maxlength' => '5'
205 ),
206 'default' => 'abc',
207 ),
208
209 array(
210 'id' => 'opt-text-7',
211 'type' => 'text',
212 'title' => 'Text usign custom styles',
213 'attributes' => array(
214 'style' => 'width: 100%; height: 40px; border-color: #93C054;'
215 ),
216 ),
217
218 array(
219 'id' => 'opt-text-8',
220 'type' => 'text',
221 'after' => '<p>It shows full width if there is no field of title.</p>',
222 ),
223
224 )
225 ) );
226
227 //
228 // Field: textarea
229 //
230 CSF::createSection( $prefix, array(
231 'parent' => 'basic_fields',
232 'title' => 'Textarea',
233 'icon' => 'far fa-square',
234 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=textarea" target="_blank">Field: textrea</a>',
235 'fields' => array(
236
237 array(
238 'id' => 'opt-textarea-1',
239 'type' => 'textarea',
240 'title' => 'Textarea',
241 ),
242
243 array(
244 'id' => 'opt-textarea-2',
245 'type' => 'textarea',
246 'title' => 'Textarea wtih default',
247 'default' => 'This is default value bla bla bla',
248 ),
249
250 array(
251 'id' => 'opt-textarea-3',
252 'type' => 'textarea',
253 'title' => 'Text with placeholder',
254 'placeholder' => 'Typed something...'
255 ),
256
257 array(
258 'id' => 'opt-textarea-4',
259 'type' => 'textarea',
260 'title' => 'Textarea with shortcoder',
261 'shortcoder' => 'csf_demo_shortcodes',
262 ),
263
264 array(
265 'id' => 'opt-textarea-5',
266 'type' => 'textarea',
267 'title' => 'Textarea field ingenuity',
268 'subtitle' => 'The field of subtitle text.',
269 'help' => 'The field of help text.',
270 'before' => '<p>The field of before text.</p>',
271 'after' => '<p>The field of after text.</p>',
272 ),
273
274 array(
275 'id' => 'opt-textarea-6',
276 'type' => 'textarea',
277 'after' => '<p>It shows full width if there is no field of title.</p>',
278 ),
279
280 )
281 ) );
282
283 //
284 // Field: select
285 //
286 CSF::createSection( $prefix, array(
287 'parent' => 'basic_fields',
288 'title' => 'Select',
289 'icon' => 'fas fa-list',
290 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=select" target="_blank">Field: select</a>',
291 'fields' => array(
292
293 array(
294 'id' => 'opt-select-1',
295 'type' => 'select',
296 'title' => 'Select',
297 'placeholder' => 'Select an option',
298 'options' => array(
299 'opt-1' => 'Option 1',
300 'opt-2' => 'Option 2',
301 'opt-3' => 'Option 3',
302 ),
303 ),
304
305 array(
306 'id' => 'opt-select-2',
307 'type' => 'select',
308 'title' => 'Select with default',
309 'placeholder' => 'Select an option',
310 'options' => array(
311 'opt-1' => 'Option 1',
312 'opt-2' => 'Option 2',
313 'opt-3' => 'Option 3',
314 ),
315 'default' => 'opt-2'
316 ),
317
318 array(
319 'id' => 'opt-select-3',
320 'type' => 'select',
321 'title' => 'Select with group related options',
322 'placeholder' => 'Select an option',
323 'options' => array(
324 'Group 1' => array(
325 'opt-1' => 'Option 1',
326 'opt-2' => 'Option 2',
327 'opt-3' => 'Option 3',
328 ),
329 'Group 2' => array(
330 'opt-4' => 'Option 4',
331 'opt-5' => 'Option 5',
332 'opt-6' => 'Option 6',
333 ),
334 'Group 3' => array(
335 'opt-7' => 'Option 7',
336 'opt-8' => 'Option 8',
337 'opt-9' => 'Option 9',
338 ),
339 ),
340 ),
341
342 array(
343 'id' => 'opt-select-4',
344 'type' => 'select',
345 'title' => 'Select with multiple choice',
346 'multiple' => true,
347 'attributes' => array(
348 'style' => 'min-width: 200px;'
349 ),
350 'options' => array(
351 'opt-1' => 'Option 1',
352 'opt-2' => 'Option 2',
353 'opt-3' => 'Option 3',
354 'opt-4' => 'Option 4',
355 'opt-5' => 'Option 5',
356 'opt-6' => 'Option 6',
357 ),
358 'default' => array( 'opt-2', 'opt-3' ),
359 ),
360
361 array(
362 'type' => 'notice',
363 'style' => 'info',
364 'content' => 'Select with <strong>chosen</strong> style.',
365 ),
366
367 array(
368 'id' => 'opt-select-5',
369 'type' => 'select',
370 'title' => 'Select with Chosen',
371 'chosen' => true,
372 'placeholder' => 'Select an option',
373 'options' => array(
374 'opt-1' => 'Option 1',
375 'opt-2' => 'Option 2',
376 'opt-3' => 'Option 3',
377 'opt-4' => 'Option 4',
378 'opt-5' => 'Option 5',
379 'opt-6' => 'Option 6',
380 ),
381 ),
382
383 array(
384 'id' => 'opt-select-6',
385 'type' => 'select',
386 'title' => 'Select with multiple Chosen',
387 'chosen' => true,
388 'multiple' => true,
389 'placeholder' => 'Select an option',
390 'options' => array(
391 'opt-1' => 'Option 1',
392 'opt-2' => 'Option 2',
393 'opt-3' => 'Option 3',
394 'opt-4' => 'Option 4',
395 'opt-5' => 'Option 5',
396 'opt-6' => 'Option 6',
397 ),
398 ),
399
400 array(
401 'id' => 'opt-select-7',
402 'type' => 'select',
403 'title' => 'Select with multiple Chosen and Sortable',
404 'chosen' => true,
405 'multiple' => true,
406 'sortable' => true,
407 'placeholder' => 'Select an option',
408 'options' => array(
409 'opt-1' => 'Option 1',
410 'opt-2' => 'Option 2',
411 'opt-3' => 'Option 3',
412 'opt-4' => 'Option 4',
413 'opt-5' => 'Option 5',
414 'opt-6' => 'Option 6',
415 ),
416 'default' => array( 'opt-1', 'opt-2', 'opt-3' )
417 ),
418
419 array(
420 'id' => 'opt-select-8',
421 'type' => 'select',
422 'title' => 'Select with multiple AJAX search Pages',
423 'chosen' => true,
424 'multiple' => true,
425 'sortable' => true,
426 'ajax' => true,
427 'options' => 'pages',
428 'placeholder' => 'Select pages',
429 ),
430
431 array(
432 'id' => 'opt-select-9',
433 'type' => 'select',
434 'title' => 'Select with multiple AJAX search Posts',
435 'chosen' => true,
436 'multiple' => true,
437 'sortable' => true,
438 'ajax' => true,
439 'options' => 'posts',
440 'placeholder' => 'Select posts',
441 ),
442
443 array(
444 'id' => 'opt-select-10',
445 'type' => 'select',
446 'title' => 'Select with AJAX search Category',
447 'chosen' => true,
448 'ajax' => true,
449 'options' => 'category',
450 'placeholder' => 'Select a category',
451 ),
452
453 array(
454 'type' => 'notice',
455 'style' => 'info',
456 'content' => 'Select with <strong>predefined wp query</strong> options.',
457 ),
458
459 array(
460 'id' => 'opt-select-11',
461 'type' => 'select',
462 'title' => 'Select with pages',
463 'placeholder' => 'Select a page',
464 'options' => 'pages',
465 ),
466
467 array(
468 'id' => 'opt-select-12',
469 'type' => 'select',
470 'title' => 'Select with posts',
471 'placeholder' => 'Select a post',
472 'options' => 'posts',
473 ),
474
475 array(
476 'id' => 'opt-select-13',
477 'type' => 'select',
478 'title' => 'Select with categories',
479 'placeholder' => 'Select a category',
480 'options' => 'categories',
481 ),
482
483 array(
484 'id' => 'opt-select-14',
485 'type' => 'select',
486 'title' => 'Select with menus',
487 'placeholder' => 'Select a menu',
488 'options' => 'menus',
489 ),
490
491 array(
492 'id' => 'opt-select-15',
493 'type' => 'select',
494 'title' => 'Select with locations',
495 'placeholder' => 'Select a location',
496 'options' => 'locations',
497 ),
498
499 array(
500 'id' => 'opt-select-16',
501 'type' => 'select',
502 'title' => 'Select with sidebars',
503 'placeholder' => 'Select a sidebar',
504 'options' => 'sidebars',
505 ),
506
507 array(
508 'id' => 'opt-select-17',
509 'type' => 'select',
510 'title' => 'Select with wp roles',
511 'placeholder' => 'Select a role',
512 'options' => 'roles',
513 ),
514
515 array(
516 'id' => 'opt-select-18',
517 'type' => 'select',
518 'title' => 'Select with users',
519 'placeholder' => 'Select a user',
520 'options' => 'users',
521 ),
522
523 array(
524 'id' => 'opt-select-19',
525 'type' => 'select',
526 'title' => 'Select with post type',
527 'placeholder' => 'Select a post type',
528 'options' => 'post_types',
529 ),
530
531 array(
532 'id' => 'opt-select-20',
533 'type' => 'select',
534 'title' => 'Select with CPT (custom post type) posts',
535 'placeholder' => 'Select a post',
536 'options' => 'posts',
537 'query_args' => array(
538 'post_type' => 'your_post_type_name',
539 ),
540 ),
541
542 array(
543 'id' => 'opt-select-21',
544 'type' => 'select',
545 'title' => 'Select with CPT (custom post type) categories',
546 'placeholder' => 'Select a category',
547 'options' => 'categories',
548 'query_args' => array(
549 'taxonomy' => 'your_taxonomy_name',
550 ),
551 ),
552
553 )
554 ) );
555
556 //
557 // Field: checkbox
558 //
559 CSF::createSection( $prefix, array(
560 'parent' => 'basic_fields',
561 'title' => 'Checkbox',
562 'icon' => 'fas fa-check-square',
563 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=checkbox" target="_blank">Field: checkbox</a>',
564 'fields' => array(
565
566 array(
567 'id' => 'opt-checkbox-1',
568 'type' => 'checkbox',
569 'title' => 'Checkbox',
570 'label' => 'The label text of the checkbox.',
571 ),
572
573 array(
574 'id' => 'opt-checkbox-2',
575 'type' => 'checkbox',
576 'title' => 'Checkbox with default',
577 'label' => 'The label text of the checkbox.',
578 'default' => true,
579 ),
580
581 array(
582 'id' => 'opt-checkbox-3',
583 'type' => 'checkbox',
584 'title' => 'Checkbox with multiple choice',
585 'options' => array(
586 'opt-1' => 'Option 1',
587 'opt-2' => 'Option 2',
588 'opt-3' => 'Option 3',
589 ),
590 ),
591
592 array(
593 'id' => 'opt-checkbox-4',
594 'type' => 'checkbox',
595 'title' => 'Checkbox inline with multiple choice',
596 'inline' => true,
597 'options' => array(
598 'opt-1' => 'Option 1',
599 'opt-2' => 'Option 2',
600 'opt-3' => 'Option 3',
601 ),
602 ),
603
604 array(
605 'id' => 'opt-checkbox-5',
606 'type' => 'checkbox',
607 'title' => 'Checkbox multiple choice with default',
608 'options' => array(
609 'opt-1' => 'Option 1',
610 'opt-2' => 'Option 2',
611 'opt-3' => 'Option 3',
612 ),
613 'default' => array( 'opt-1', 'opt-2' )
614 ),
615
616 array(
617 'id' => 'opt-checkbox-6',
618 'type' => 'checkbox',
619 'title' => 'Checkbox with group related options',
620 'options' => array(
621 'Group 1' => array(
622 'opt-1' => 'Option 1',
623 'opt-2' => 'Option 2',
624 'opt-3' => 'Option 3',
625 ),
626 'Group 2' => array(
627 'opt-4' => 'Option 4',
628 'opt-5' => 'Option 5',
629 'opt-6' => 'Option 6',
630 ),
631 ),
632 ),
633
634 array(
635 'id' => 'opt-checkbox-7',
636 'type' => 'checkbox',
637 'title' => 'Checkbox testing on many items',
638 'options' => array(
639 'opt-1' => 'Option 1',
640 'opt-2' => 'Option 2',
641 'opt-3' => 'Option 3',
642 'opt-4' => 'Option 4',
643 'opt-5' => 'Option 5',
644 'opt-6' => 'Option 6',
645 'opt-7' => 'Option 7',
646 'opt-8' => 'Option 8',
647 'opt-9' => 'Option 9',
648 'opt-10' => 'Option 10',
649 'opt-11' => 'Option 11',
650 'opt-12' => 'Option 12',
651 'opt-13' => 'Option 13',
652 'opt-14' => 'Option 14',
653 'opt-15' => 'Option 15',
654 ),
655 'desc' => 'Vertical scroll showing automatically after add many items',
656 ),
657
658 array(
659 'type' => 'notice',
660 'style' => 'info',
661 'content' => 'Checkbox with <strong>predefined wp query</strong> options similar like <strong>select</strong> field. (see select field for all options models.)',
662 ),
663
664 array(
665 'id' => 'opt-checkbox-8',
666 'type' => 'checkbox',
667 'title' => 'Checkbox with categories',
668 'options' => 'categories',
669 ),
670
671 )
672 ) );
673
674 //
675 // Field: radio
676 //
677 CSF::createSection( $prefix, array(
678 'parent' => 'basic_fields',
679 'title' => 'Radio',
680 'icon' => 'fas fa-dot-circle',
681 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=radio" target="_blank">Field: radio</a>',
682 'fields' => array(
683
684 array(
685 'id' => 'opt-radio-1',
686 'type' => 'radio',
687 'title' => 'Radio',
688 'options' => array(
689 'opt-1' => 'Option 1',
690 'opt-2' => 'Option 2',
691 'opt-3' => 'Option 3',
692 ),
693 ),
694
695 array(
696 'id' => 'opt-radio-2',
697 'type' => 'radio',
698 'title' => 'Radio with default',
699 'options' => array(
700 'opt-1' => 'Option 1',
701 'opt-2' => 'Option 2',
702 'opt-3' => 'Option 3',
703 ),
704 'default' => 'opt-2',
705 ),
706
707 array(
708 'id' => 'opt-radio-3',
709 'type' => 'radio',
710 'title' => 'Radio with inline style',
711 'inline' => true,
712 'options' => array(
713 'opt-1' => 'Option 1',
714 'opt-2' => 'Option 2',
715 'opt-3' => 'Option 3',
716 ),
717 ),
718
719 array(
720 'id' => 'opt-radio-4',
721 'type' => 'radio',
722 'title' => 'Radio with group related options',
723 'options' => array(
724 'Group 1' => array(
725 'opt-1' => 'Option 1',
726 'opt-2' => 'Option 2',
727 'opt-3' => 'Option 3',
728 ),
729 'Group 2' => array(
730 'opt-4' => 'Option 4',
731 'opt-5' => 'Option 5',
732 'opt-6' => 'Option 6',
733 ),
734 ),
735 ),
736
737 array(
738 'id' => 'opt-radio-5',
739 'type' => 'radio',
740 'title' => 'Radio testing on many items',
741 'options' => array(
742 'opt-1' => 'Option 1',
743 'opt-2' => 'Option 2',
744 'opt-3' => 'Option 3',
745 'opt-4' => 'Option 4',
746 'opt-5' => 'Option 5',
747 'opt-6' => 'Option 6',
748 'opt-7' => 'Option 7',
749 'opt-8' => 'Option 8',
750 'opt-9' => 'Option 9',
751 'opt-10' => 'Option 10',
752 'opt-11' => 'Option 11',
753 'opt-12' => 'Option 12',
754 'opt-13' => 'Option 13',
755 'opt-14' => 'Option 14',
756 'opt-15' => 'Option 15',
757 ),
758 'desc' => 'Vertical scroll showing automatically after add many items'
759 ),
760
761 array(
762 'type' => 'notice',
763 'style' => 'info',
764 'content' => 'Radio with <strong>predefined wp query</strong> options similar like <strong>select</strong> field. (see select field for all options models.)',
765 ),
766
767 array(
768 'id' => 'opt-radio-6',
769 'type' => 'radio',
770 'title' => 'Radio with categories',
771 'options' => 'categories',
772 ),
773
774 )
775 ) );
776
777 //
778 // Repeater Fields
779 //
780 CSF::createSection( $prefix, array(
781 'id' => 'repeater_fields',
782 'title' => 'Repeater Fields',
783 'icon' => 'far fa-clone',
784 ) );
785
786 //
787 // Field: repeater
788 //
789 CSF::createSection( $prefix, array(
790 'parent' => 'repeater_fields',
791 'title' => 'Repeater',
792 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=repeater" target="_blank">Field: repeater</a>',
793 'fields' => array(
794
795 array(
796 'id' => 'opt-repeater-1',
797 'type' => 'repeater',
798 'title' => 'Repeater',
799 'fields' => array(
800 array(
801 'id' => 'opt-text',
802 'type' => 'text',
803 'title' => 'Text'
804 ),
805 ),
806 ),
807
808 array(
809 'id' => 'opt-repeater-2',
810 'type' => 'repeater',
811 'title' => 'Repeater with default',
812 'fields' => array(
813 array(
814 'id' => 'opt-text',
815 'type' => 'text',
816 'title' => 'Text',
817 ),
818 ),
819 'default' => array(
820 array(
821 'opt-text' => 'Text default 1',
822 ),
823 array(
824 'opt-text' => 'Text default 2',
825 ),
826 ),
827 ),
828
829 array(
830 'id' => 'opt-repeater-3',
831 'type' => 'repeater',
832 'title' => 'Repeater with multiple fields',
833 'fields' => array(
834 array(
835 'id' => 'opt-switcher',
836 'type' => 'switcher',
837 'title' => 'Switcher',
838 ),
839 array(
840 'id' => 'opt-color',
841 'type' => 'color',
842 'title' => 'Color',
843 ),
844 array(
845 'id' => 'opt-text',
846 'type' => 'text',
847 'title' => 'Text',
848 ),
849 ),
850 'default' => array(
851 array(
852 'opt-switcher' => false,
853 'opt-color' => '#3498db',
854 'opt-text' => 'Text default 1',
855 ),
856 ),
857 ),
858
859 array(
860 'id' => 'opt-repeater-4',
861 'type' => 'repeater',
862 'title' => 'Repeater with limited (min - max items)',
863 'subtitle' => 'The maximum/minimum number of items the user can add. (In this example min:1, max:3)',
864 'button_title' => 'Add Text',
865 'min' => 1,
866 'max' => 3,
867 'fields' => array(
868 array(
869 'id' => 'opt-text',
870 'type' => 'text',
871 'title' => 'Text',
872 ),
873 ),
874 'default' => array(
875 array(
876 'opt-text' => 'Text default 1',
877 ),
878 array(
879 'opt-text' => 'Text default 2',
880 ),
881 ),
882 ),
883
884 array(
885 'id' => 'opt-repeater-6',
886 'type' => 'repeater',
887 'title' => 'Repeater nested repeater',
888 'subtitle' => 'Can be added unlimited nested repeater',
889 'fields' => array(
890 array(
891 'id' => 'opt-text',
892 'type' => 'text',
893 'title' => 'Text',
894 ),
895 array(
896 'id' => 'opt-repeater-6-nested-1',
897 'type' => 'repeater',
898 'title' => 'Repeater',
899 'fields' => array(
900 array(
901 'id' => 'opt-text',
902 'type' => 'text',
903 'title' => 'Text'
904 ),
905 ),
906 ),
907 ),
908 'default' => array(
909 array(
910 'opt-text' => 'Text default 1',
911 'opt-repeater-6-nested-1' => array(
912 array(
913 'opt-text' => 'Text default 1',
914 ),
915 array(
916 'opt-text' => 'Text default 2',
917 ),
918 ),
919 ),
920 ),
921 ),
922
923 )
924 ) );
925
926 //
927 // Field: group
928 //
929 CSF::createSection( $prefix, array(
930 'parent' => 'repeater_fields',
931 'title' => 'Group',
932 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=group" target="_blank">Field: group</a>',
933 'fields' => array(
934
935 array(
936 'id' => 'opt-group-1',
937 'type' => 'group',
938 'title' => 'Group',
939 'fields' => array(
940 array(
941 'id' => 'opt-text',
942 'type' => 'text',
943 'title' => 'Text',
944 ),
945 array(
946 'id' => 'opt-switcher',
947 'type' => 'switcher',
948 'title' => 'Switcher',
949 ),
950 array(
951 'id' => 'opt-textarea',
952 'type' => 'textarea',
953 'title' => 'Textarea',
954 ),
955 )
956 ),
957
958 array(
959 'id' => 'opt-group-2',
960 'type' => 'group',
961 'title' => 'Group with default',
962 'fields' => array(
963 array(
964 'id' => 'opt-text',
965 'type' => 'text',
966 'title' => 'Text',
967 ),
968 array(
969 'id' => 'opt-switcher',
970 'type' => 'switcher',
971 'title' => 'Switcher',
972 ),
973 array(
974 'id' => 'opt-textarea',
975 'type' => 'textarea',
976 'title' => 'Textarea',
977 ),
978 ),
979 'default' => array(
980 array(
981 'opt-text' => 'Some text 1',
982 'opt-switcher' => true,
983 'opt-textarea' => 'Some textarea content 1',
984 ),
985 array(
986 'opt-text' => 'Some text 2',
987 'opt-switcher' => false,
988 'opt-textarea' => 'Some textarea content 2',
989 ),
990 )
991 ),
992
993 array(
994 'id' => 'opt-group-3',
995 'type' => 'group',
996 'title' => 'Group with limited (min - max items)',
997 'subtitle' => 'The maximum/minimum number of items the user can add. (In this example min:1, max:3)',
998 'min' => 1,
999 'max' => 3,
1000 'fields' => array(
1001 array(
1002 'id' => 'opt-text',
1003 'type' => 'text',
1004 'title' => 'Text',
1005 ),
1006 array(
1007 'id' => 'opt-textarea',
1008 'type' => 'textarea',
1009 'title' => 'Textarea',
1010 ),
1011 ),
1012 'default' => array(
1013 array(
1014 'opt-text' => 'Limited text 1',
1015 'opt-textarea' => 'Limited textarea content 1',
1016 ),
1017 array(
1018 'opt-text' => 'Limited text 2',
1019 'opt-textarea' => 'Limited textarea content 2',
1020 ),
1021 )
1022 ),
1023
1024 array(
1025 'id' => 'opt-group-4',
1026 'type' => 'group',
1027 'title' => 'Group with WP Editor',
1028 'subtitle' => 'WP Editor integrated for Ajax Call.',
1029 'fields' => array(
1030 array(
1031 'id' => 'opt-text',
1032 'type' => 'text',
1033 'title' => 'Text',
1034 ),
1035 array(
1036 'id' => 'opt-editor',
1037 'type' => 'wp_editor',
1038 'title' => 'WP Editor',
1039 ),
1040 ),
1041 'default' => array(
1042 array(
1043 'opt-text' => 'WP Editor 1',
1044 'opt-editor' => 'Editor content 1',
1045 ),
1046 array(
1047 'opt-text' => 'WP Editor 2',
1048 'opt-editor' => 'Editor content 2',
1049 ),
1050 )
1051 ),
1052
1053 array(
1054 'id' => 'opt-group-5',
1055 'type' => 'group',
1056 'title' => 'Group nested',
1057 'subtitle' => 'Can be added unlimited nested groups',
1058 'fields' => array(
1059 array(
1060 'id' => 'opt-text',
1061 'type' => 'text',
1062 'title' => 'Text',
1063 ),
1064 array(
1065 'id' => 'opt-group-5-sublevel-1',
1066 'type' => 'group',
1067 'title' => 'Group Nested',
1068 'fields' => array(
1069 array(
1070 'id' => 'opt-text',
1071 'type' => 'text',
1072 'title' => 'Text',
1073 ),
1074 array(
1075 'id' => 'opt-group-5-sublevel-2',
1076 'type' => 'group',
1077 'title' => 'Group Nested',
1078 'fields' => array(
1079 array(
1080 'id' => 'opt-text',
1081 'type' => 'text',
1082 'title' => 'Text',
1083 ),
1084 array(
1085 'id' => 'opt-switcher',
1086 'type' => 'switcher',
1087 'title' => 'Switcher',
1088 ),
1089 array(
1090 'id' => 'opt-textarea',
1091 'type' => 'textarea',
1092 'title' => 'Textarea',
1093 ),
1094 )
1095 ),
1096 array(
1097 'id' => 'opt-switcher',
1098 'type' => 'switcher',
1099 'title' => 'Switcher',
1100 ),
1101 array(
1102 'id' => 'opt-textarea',
1103 'type' => 'textarea',
1104 'title' => 'Textarea',
1105 ),
1106 )
1107 ),
1108 array(
1109 'id' => 'opt-switcher',
1110 'type' => 'switcher',
1111 'title' => 'Switcher',
1112 ),
1113 array(
1114 'id' => 'opt-textarea',
1115 'type' => 'textarea',
1116 'title' => 'Textarea',
1117 ),
1118 ),
1119 'default' => array(
1120
1121 // top level defaults
1122 array(
1123 'opt-text' => 'Top Level 1',
1124
1125 // sub level 1 defaults
1126 'opt-group-5-sublevel-1' => array(
1127 array(
1128 'opt-text' => 'Sub Level 1',
1129
1130 // sub level 2 defaults
1131 'opt-group-5-sublevel-2' => array(
1132 array(
1133 'opt-text' => 'Sub Sub Level 1',
1134 ),
1135 array(
1136 'opt-text' => 'Sub Sub Level 2',
1137 )
1138 ),
1139 ),
1140 array(
1141 'opt-text' => 'Sub Level 2',
1142 )
1143 ),
1144 ),
1145
1146 // top level defaults
1147 array(
1148 'opt-text' => 'Top Level 2',
1149 ),
1150 )
1151 ),
1152
1153 array(
1154 'id' => 'opt-group-6',
1155 'type' => 'group',
1156 'title' => 'Group with Repeater Field',
1157 'fields' => array(
1158 array(
1159 'id' => 'opt-text',
1160 'type' => 'text',
1161 'title' => 'Text',
1162 ),
1163 array(
1164 'id' => 'opt-group-6-repeater',
1165 'type' => 'repeater',
1166 'title' => 'Repeater',
1167 'fields' => array(
1168 array(
1169 'id' => 'opt-text',
1170 'type' => 'text',
1171 'title' => 'Text'
1172 ),
1173 ),
1174 ),
1175 array(
1176 'id' => 'opt-switcher',
1177 'type' => 'switcher',
1178 'title' => 'Switcher',
1179 ),
1180 array(
1181 'id' => 'opt-textarea',
1182 'type' => 'textarea',
1183 'title' => 'Textarea',
1184 ),
1185 ),
1186 'default' => array(
1187 array(
1188 'opt-text' => 'Some text 1',
1189 'opt-group-6-repeater' => array(
1190 array(
1191 'opt-text' => 'Some text 1',
1192 ),
1193 array(
1194 'opt-text' => 'Some text 2',
1195 ),
1196 )
1197 ),
1198 )
1199 ),
1200
1201 array(
1202 'id' => 'opt-group-7',
1203 'type' => 'group',
1204 'title' => 'Group with static prefix of title',
1205 'subtitle' => 'accordion_title_prefix => "Static Prefix:"',
1206 'accordion_title_prefix' => 'Static Prefix:',
1207 'fields' => array(
1208 array(
1209 'id' => 'opt-text',
1210 'type' => 'text',
1211 'title' => 'Text',
1212 ),
1213 array(
1214 'id' => 'opt-switcher',
1215 'type' => 'switcher',
1216 'title' => 'Switcher',
1217 ),
1218 array(
1219 'id' => 'opt-textarea',
1220 'type' => 'textarea',
1221 'title' => 'Textarea',
1222 ),
1223 ),
1224 'default' => array(
1225 array(
1226 'opt-text' => 'Some text 1',
1227 'opt-switcher' => true,
1228 'opt-textarea' => 'Some textarea content 1',
1229 ),
1230 array(
1231 'opt-text' => 'Some text 2',
1232 'opt-switcher' => false,
1233 'opt-textarea' => 'Some textarea content 2',
1234 ),
1235 )
1236 ),
1237
1238 array(
1239 'id' => 'opt-group-8',
1240 'type' => 'group',
1241 'title' => 'Group with title numbers',
1242 'subtitle' => 'accordion_title_number => true',
1243 'accordion_title_number' => true,
1244 'fields' => array(
1245 array(
1246 'id' => 'opt-text',
1247 'type' => 'text',
1248 'title' => 'Text',
1249 ),
1250 array(
1251 'id' => 'opt-switcher',
1252 'type' => 'switcher',
1253 'title' => 'Switcher',
1254 ),
1255 array(
1256 'id' => 'opt-textarea',
1257 'type' => 'textarea',
1258 'title' => 'Textarea',
1259 ),
1260 ),
1261 'default' => array(
1262 array(
1263 'opt-text' => 'Some text 1',
1264 'opt-switcher' => true,
1265 'opt-textarea' => 'Some textarea content 1',
1266 ),
1267 array(
1268 'opt-text' => 'Some text 2',
1269 'opt-switcher' => false,
1270 'opt-textarea' => 'Some textarea content 2',
1271 ),
1272 )
1273 ),
1274
1275 array(
1276 'id' => 'opt-group-9',
1277 'type' => 'group',
1278 'title' => 'Group with custom titles',
1279 'subtitle' => 'accordion_title_by => array( \'opt-name\', \'opt-surname\' )',
1280 'accordion_title_by' => array( 'opt-name', 'opt-surname' ),
1281 'fields' => array(
1282 array(
1283 'id' => 'opt-name',
1284 'type' => 'text',
1285 'title' => 'Name',
1286 ),
1287 array(
1288 'id' => 'opt-surname',
1289 'type' => 'text',
1290 'title' => 'Surname',
1291 ),
1292 array(
1293 'id' => 'opt-textarea',
1294 'type' => 'textarea',
1295 'title' => 'Textarea',
1296 ),
1297 ),
1298 'default' => array(
1299 array(
1300 'opt-name' => 'John',
1301 'opt-surname' => 'Doe',
1302 'opt-textarea' => 'Textarea 1',
1303 ),
1304 array(
1305 'opt-name' => 'Jane',
1306 'opt-surname' => 'Doe',
1307 'opt-textarea' => 'Textarea 1',
1308 ),
1309 )
1310 ),
1311
1312 array(
1313 'id' => 'opt-group-10',
1314 'type' => 'group',
1315 'title' => 'Group with custom titles and prefix',
1316 'subtitle' => 'accordion_title_by => array( \'opt-text\', \'opt-textarea\' )<br />accordion_title_by_prefix => \' | \'',
1317 'accordion_title_by' => array( 'opt-text', 'opt-textarea' ),
1318 'accordion_title_by_prefix' => ' | ',
1319 'fields' => array(
1320 array(
1321 'id' => 'opt-text',
1322 'type' => 'text',
1323 'title' => 'Title',
1324 ),
1325 array(
1326 'id' => 'opt-textarea',
1327 'type' => 'textarea',
1328 'title' => 'Textarea',
1329 ),
1330 ),
1331 'default' => array(
1332 array(
1333 'opt-text' => 'Text 1',
1334 'opt-textarea' => 'Textarea 1',
1335 ),
1336 array(
1337 'opt-text' => 'Text 2',
1338 'opt-textarea' => 'Textarea 1',
1339 ),
1340 )
1341 ),
1342
1343 )
1344 ) );
1345
1346 //
1347 // Combine Fields
1348 //
1349 CSF::createSection( $prefix, array(
1350 'id' => 'combine_fields',
1351 'title' => 'Combine Fields',
1352 'icon' => 'fas fa-bars',
1353 ) );
1354
1355 //
1356 // Field: accordion
1357 //
1358 CSF::createSection( $prefix, array(
1359 'parent' => 'combine_fields',
1360 'title' => 'Accordion',
1361 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=accordion" target="_blank">Field: accordion</a>',
1362 'fields' => array(
1363
1364 array(
1365 'id' => 'opt-accordion-1',
1366 'type' => 'accordion',
1367 'title' => 'Accordion',
1368 'accordions' => array(
1369
1370 array(
1371 'title' => 'Accordion 1',
1372 'fields' => array(
1373 array(
1374 'id' => 'opt-text-1',
1375 'type' => 'text',
1376 'title' => 'Text',
1377 ),
1378 array(
1379 'id' => 'opt-switcher-1',
1380 'type' => 'switcher',
1381 'title' => 'Switcher',
1382 ),
1383 array(
1384 'id' => 'opt-textarea-1',
1385 'type' => 'textarea',
1386 'title' => 'Textarea',
1387 ),
1388 )
1389 ),
1390
1391 array(
1392 'title' => 'Accordion 2',
1393 'fields' => array(
1394 array(
1395 'id' => 'opt-text-2',
1396 'type' => 'text',
1397 'title' => 'Text',
1398 ),
1399 array(
1400 'id' => 'opt-color-1',
1401 'type' => 'color',
1402 'title' => 'Color',
1403 ),
1404 )
1405 ),
1406
1407 )
1408 ),
1409
1410 array(
1411 'id' => 'opt-accordion-2',
1412 'type' => 'accordion',
1413 'title' => 'Accordion with default',
1414 'accordions' => array(
1415
1416 array(
1417 'title' => 'Fields 1',
1418 'fields' => array(
1419 array(
1420 'id' => 'opt-text-1',
1421 'type' => 'text',
1422 'title' => 'Text 1',
1423 ),
1424 array(
1425 'id' => 'opt-text-2',
1426 'type' => 'text',
1427 'title' => 'Text 2',
1428 ),
1429 )
1430 ),
1431
1432 array(
1433 'title' => 'Fields 2',
1434 'fields' => array(
1435 array(
1436 'id' => 'opt-color-1',
1437 'type' => 'color',
1438 'title' => 'Color 1',
1439 ),
1440 array(
1441 'id' => 'opt-color-2',
1442 'type' => 'color',
1443 'title' => 'Color 2',
1444 ),
1445 )
1446 ),
1447
1448 array(
1449 'title' => 'Fields 3',
1450 'fields' => array(
1451 array(
1452 'id' => 'opt-textarea-1',
1453 'type' => 'textarea',
1454 'title' => 'Textarea 3',
1455 ),
1456 array(
1457 'id' => 'opt-textarea-2',
1458 'type' => 'textarea',
1459 'title' => 'Textarea 4',
1460 ),
1461 )
1462 ),
1463
1464 ),
1465 'default' => array(
1466 'opt-text-1' => 'This is text 1 default value',
1467 'opt-text-2' => 'This is text 2 default value',
1468 'opt-color-1' => '#1e73be',
1469 'opt-color-2' => '#ffbc00',
1470 'opt-textarea-1' => 'This is textarea 1 default value',
1471 'opt-textarea-2' => 'This is textarea 2 default value',
1472 )
1473 ),
1474
1475 array(
1476 'id' => 'accordion_3',
1477 'type' => 'accordion',
1478 'title' => 'Accordion with custom icons',
1479 'accordions' => array(
1480
1481 array(
1482 'title' => 'Other 1',
1483 'icon' => 'fas fa-check',
1484 'fields' => array(
1485 array(
1486 'id' => 'opt-text-1',
1487 'type' => 'text',
1488 'title' => 'Text 1',
1489 ),
1490 )
1491 ),
1492
1493 array(
1494 'title' => 'Other 2',
1495 'icon' => 'fas fa-star',
1496 'fields' => array(
1497 array(
1498 'id' => 'opt-text-2',
1499 'type' => 'text',
1500 'title' => 'Text 2',
1501 ),
1502 )
1503 ),
1504
1505 )
1506 ),
1507
1508 )
1509 ) );
1510
1511 //
1512 // Field: tabbed
1513 //
1514 CSF::createSection( $prefix, array(
1515 'parent' => 'combine_fields',
1516 'title' => 'Tabbed',
1517 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=tabbed" target="_blank">Field: tabbed</a>',
1518 'fields' => array(
1519
1520 array(
1521 'id' => 'opt-tabbed-1',
1522 'type' => 'tabbed',
1523 'title' => 'Tabbed',
1524 'tabs' => array(
1525
1526 array(
1527 'title' => 'Tab 1',
1528 'fields' => array(
1529 array(
1530 'id' => 'opt-text-1',
1531 'type' => 'text',
1532 'title' => 'Text 1',
1533 ),
1534 array(
1535 'id' => 'opt-textarea-1',
1536 'type' => 'textarea',
1537 'title' => 'Textarea 1',
1538 ),
1539 ),
1540 ),
1541
1542 array(
1543 'title' => 'Tab 2',
1544 'fields' => array(
1545 array(
1546 'id' => 'opt-text-2',
1547 'type' => 'text',
1548 'title' => 'Text 2',
1549 ),
1550 array(
1551 'id' => 'opt-textarea-2',
1552 'type' => 'textarea',
1553 'title' => 'Textarea 2',
1554 ),
1555 ),
1556 ),
1557
1558 ),
1559 ),
1560
1561 array(
1562 'id' => 'opt-tabbed-2',
1563 'type' => 'tabbed',
1564 'title' => 'Tabbed with default and icons',
1565 'tabs' => array(
1566 array(
1567 'title' => 'Fields 1',
1568 'icon' => 'fas fa-check',
1569 'fields' => array(
1570 array(
1571 'id' => 'opt-text-1',
1572 'type' => 'text',
1573 'title' => 'Text 1',
1574 ),
1575 array(
1576 'id' => 'opt-text-2',
1577 'type' => 'text',
1578 'title' => 'Text 2',
1579 ),
1580 ),
1581 ),
1582 array(
1583 'title' => 'Fields 2',
1584 'icon' => 'fas fa-star',
1585 'fields' => array(
1586 array(
1587 'id' => 'opt-color-1',
1588 'type' => 'color',
1589 'title' => 'Color 1',
1590 ),
1591 array(
1592 'id' => 'opt-color-2',
1593 'type' => 'color',
1594 'title' => 'Color 2',
1595 ),
1596 ),
1597 ),
1598 array(
1599 'title' => 'Fields 3',
1600 'icon' => 'fas fa-cog',
1601 'fields' => array(
1602 array(
1603 'id' => 'opt-textarea-1',
1604 'type' => 'textarea',
1605 'title' => 'Textarea 1',
1606 ),
1607 array(
1608 'id' => 'opt-textarea-2',
1609 'type' => 'textarea',
1610 'title' => 'Textarea 2',
1611 ),
1612 ),
1613 ),
1614 ),
1615 'default' => array(
1616 'opt-text-1' => 'This is text 1 default value',
1617 'opt-text-2' => 'This is text 2 default value',
1618 'opt-color-1' => '#1e73be',
1619 'opt-color-2' => '#ffbc00',
1620 'opt-textarea-1' => 'This is textarea 1 default value',
1621 'opt-textarea-2' => 'This is textarea 2 default value',
1622 )
1623 ),
1624
1625 )
1626 ) );
1627
1628 //
1629 // Field: fieldset
1630 //
1631 CSF::createSection( $prefix, array(
1632 'parent' => 'combine_fields',
1633 'title' => 'Fieldset',
1634 'fields' => array(
1635
1636 array(
1637 'id' => 'opt-fieldset-1',
1638 'type' => 'fieldset',
1639 'title' => 'Fieldset',
1640 'fields' => array(
1641 array(
1642 'id' => 'opt-color',
1643 'type' => 'color',
1644 'title' => 'Color',
1645 ),
1646 array(
1647 'id' => 'opt-text',
1648 'type' => 'text',
1649 'title' => 'Text',
1650 ),
1651 array(
1652 'id' => 'opt-textarea',
1653 'type' => 'textarea',
1654 'title' => 'Textarea',
1655 ),
1656 ),
1657 ),
1658
1659 array(
1660 'id' => 'opt-fieldset-2',
1661 'type' => 'fieldset',
1662 'title' => 'Fieldset with default',
1663 'fields' => array(
1664 array(
1665 'type' => 'subheading',
1666 'content' => 'Title of the fieldset',
1667 ),
1668 array(
1669 'id' => 'opt-color',
1670 'type' => 'color',
1671 'title' => 'Color',
1672 ),
1673 array(
1674 'id' => 'opt-text',
1675 'type' => 'text',
1676 'title' => 'Text',
1677 ),
1678 array(
1679 'id' => 'opt-textarea',
1680 'type' => 'textarea',
1681 'title' => 'Textarea',
1682 ),
1683 ),
1684 'default' => array(
1685 'opt-color' => '#1e73be',
1686 'opt-text' => 'This is text default value',
1687 'opt-textarea' => 'This is textarea default value',
1688 )
1689 ),
1690
1691 )
1692 ) );
1693
1694 //
1695 // Media and Upload Fields
1696 //
1697 CSF::createSection( $prefix, array(
1698 'id' => 'media_fields',
1699 'title' => 'Media and Upload Fields',
1700 'icon' => 'fas fa-upload',
1701 ) );
1702
1703 //
1704 // Field: media
1705 //
1706 CSF::createSection( $prefix, array(
1707 'parent' => 'media_fields',
1708 'title' => 'Media',
1709 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=media" target="_blank">Field: media</a>',
1710 'fields' => array(
1711
1712 array(
1713 'id' => 'opt-media-1',
1714 'type' => 'media',
1715 'title' => 'Media',
1716 ),
1717
1718 array(
1719 'id' => 'opt-media-2',
1720 'type' => 'media',
1721 'title' => 'Media without preview',
1722 'preview' => false,
1723 ),
1724
1725 array(
1726 'id' => 'opt-media-3',
1727 'type' => 'media',
1728 'title' => 'Media without url',
1729 'url' => false,
1730 ),
1731
1732 array(
1733 'id' => 'opt-media-4',
1734 'type' => 'media',
1735 'title' => 'Media with only image type',
1736 'library' => 'image',
1737 ),
1738
1739 array(
1740 'id' => 'opt-media-5',
1741 'type' => 'media',
1742 'title' => 'Media with only video type',
1743 'library' => 'video',
1744 ),
1745
1746 array(
1747 'id' => 'opt-media-6',
1748 'type' => 'media',
1749 'title' => 'Media with only audio type',
1750 'library' => 'audio',
1751 ),
1752
1753 )
1754 ) );
1755
1756 //
1757 // Field: upload
1758 //
1759 CSF::createSection( $prefix, array(
1760 'parent' => 'media_fields',
1761 'title' => 'Upload',
1762 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=upload" target="_blank">Field: upload</a>',
1763 'fields' => array(
1764
1765 array(
1766 'id' => 'opt-upload-1',
1767 'type' => 'upload',
1768 'title' => 'Upload',
1769 ),
1770
1771 array(
1772 'id' => 'opt-upload-2',
1773 'type' => 'upload',
1774 'title' => 'Upload with preview',
1775 'preview' => true,
1776 ),
1777
1778 array(
1779 'id' => 'opt-upload-3',
1780 'type' => 'upload',
1781 'title' => 'Upload with placeholder',
1782 'placeholder' => 'http://'
1783 ),
1784
1785 array(
1786 'id' => 'opt-upload-4',
1787 'type' => 'upload',
1788 'title' => 'Upload with only image type',
1789 'library' => 'image',
1790 'button_title' => 'Upload Image',
1791 ),
1792
1793 array(
1794 'id' => 'opt-upload-5',
1795 'type' => 'upload',
1796 'title' => 'Upload with only video type',
1797 'library' => 'video',
1798 'button_title' => 'Upload Video',
1799 ),
1800
1801 array(
1802 'id' => 'opt-upload-6',
1803 'type' => 'upload',
1804 'title' => 'Upload with only audio type',
1805 'library' => 'audio',
1806 'button_title' => 'Upload Audio',
1807 ),
1808
1809 )
1810 ) );
1811
1812 //
1813 // Field: gallery
1814 //
1815 CSF::createSection( $prefix, array(
1816 'parent' => 'media_fields',
1817 'title' => 'Gallery',
1818 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=gallery" target="_blank">Field: gallery</a>',
1819 'fields' => array(
1820
1821 array(
1822 'id' => 'opt-gallery-1',
1823 'type' => 'gallery',
1824 'title' => 'Gallery',
1825 ),
1826
1827 array(
1828 'id' => 'opt-gallery-2',
1829 'type' => 'gallery',
1830 'title' => 'Gallery with custom button names',
1831 'add_title' => 'Add Image(s)',
1832 'edit_title' => 'Edit Images',
1833 'clear_title' => 'Remove Images',
1834 ),
1835
1836 )
1837 ) );
1838
1839 //
1840 // Editor Fields
1841 //
1842 CSF::createSection( $prefix, array(
1843 'id' => 'editor_fields',
1844 'title' => 'Editor Fields',
1845 'icon' => 'fas fa-code',
1846 ) );
1847
1848 //
1849 // Field: code_editor
1850 //
1851 CSF::createSection( $prefix, array(
1852 'parent' => 'editor_fields',
1853 'title' => 'Code Editor',
1854 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=code-editor" target="_blank">Field: code_editor</a>',
1855 'fields' => array(
1856
1857 array(
1858 'id' => 'opt-code-editor-1',
1859 'type' => 'code_editor',
1860 'title' => 'Code Editor',
1861 'subtitle' => '<strong>Default Editor</strong> Using: theme: default and mode: htmlmixed',
1862 ),
1863
1864 array(
1865 'id' => 'code_editor_2',
1866 'type' => 'code_editor',
1867 'title' => 'Code Editor',
1868 'subtitle' => '<strong>HTML Editor</strong> Using: theme: shadowfox and mode: htmlmixed',
1869 'settings' => array(
1870 'theme' => 'shadowfox',
1871 'mode' => 'htmlmixed',
1872 ),
1873 'default' =>'<div class="wrapper">
1874 <h1>Hello world</h1>
1875 <p>Lorem <strong>ipsum</strong> dollar.</p>
1876 </div>',
1877 ),
1878
1879 array(
1880 'id' => 'opt-code-editor-2',
1881 'type' => 'code_editor',
1882 'title' => 'Code Editor',
1883 'subtitle' => '<strong>JS Editor</strong> Using: theme: dracula and mode: javascript',
1884 'settings' => array(
1885 'theme' => 'dracula',
1886 'mode' => 'javascript',
1887 ),
1888 'default' =>';(function( $, window, document, undefined ) {
1889 "use strict";
1890
1891 $(document).ready( function() {
1892
1893 // do stuff
1894
1895 });
1896
1897 })( jQuery, window, document );',
1898 ),
1899
1900 array(
1901 'id' => 'opt-code-editor-3',
1902 'type' => 'code_editor',
1903 'desc' => '<strong>CSS Editor</strong> It shows full width if there is no field of title and using: theme: mbo and mode: css',
1904 'settings' => array(
1905 'theme' => 'mbo',
1906 'mode' => 'css',
1907 ),
1908 'default' =>'.wrapper {
1909 font-family: "Open Sans";
1910 font-size: 13px;
1911 width: 250px;
1912 height: 100px;
1913 color: #fff;
1914 background-color: #555;
1915 }',
1916 ),
1917
1918 )
1919 ) );
1920
1921 //
1922 // Field: wp_editor
1923 //
1924 CSF::createSection( $prefix, array(
1925 'parent' => 'editor_fields',
1926 'title' => 'WP Editor',
1927 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=wp-editor" target="_blank">Field: wp_editor</a>',
1928 'fields' => array(
1929
1930 array(
1931 'id' => 'opt-wp-editor-1',
1932 'type' => 'wp_editor',
1933 'title' => 'WP Editor',
1934 ),
1935
1936 array(
1937 'id' => 'opt-wp-editor-2',
1938 'type' => 'wp_editor',
1939 'title' => 'WP Editor with Custom Height and No Media Buttons',
1940 'subtitle' => 'Settings:<br />height => 100px,<br />media_buttons => false',
1941 'height' => '100px',
1942 'media_buttons' => false,
1943 ),
1944
1945 array(
1946 'id' => 'opt-wp-editor-3',
1947 'type' => 'wp_editor',
1948 'title' => 'WP Editor without QuickTags and Media Buttons',
1949 'subtitle' => 'Settings:<br />height => 100px,<br />media_buttons => false,<br />quicktags => false',
1950 'height' => '100px',
1951 'media_buttons' => false,
1952 'quicktags' => false,
1953 ),
1954
1955 array(
1956 'id' => 'opt-wp-editor-4',
1957 'type' => 'wp_editor',
1958 'title' => 'WP Editor without Tinymce and Media Buttons',
1959 'subtitle' => 'Settings:<br />height => 100px,<br />media_buttons => false,<br />tinymce => false',
1960 'height' => '100px',
1961 'media_buttons' => false,
1962 'tinymce' => false,
1963 ),
1964
1965 )
1966 ) );
1967
1968 //
1969 // Color Fields
1970 //
1971 CSF::createSection( $prefix, array(
1972 'id' => 'color_fields',
1973 'title' => 'Color Fields',
1974 'icon' => 'fas fa-tint',
1975 ) );
1976
1977 //
1978 // Field: color
1979 //
1980 CSF::createSection( $prefix, array(
1981 'parent' => 'color_fields',
1982 'title' => 'Color',
1983 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=color" target="_blank">Field: color</a>',
1984 'fields' => array(
1985
1986 array(
1987 'id' => 'opt-color-1',
1988 'type' => 'color',
1989 'title' => 'Color',
1990 ),
1991
1992 array(
1993 'id' => 'opt-color-2',
1994 'type' => 'color',
1995 'title' => 'Color with default (hex)',
1996 'default' => '#3498db',
1997 ),
1998
1999 array(
2000 'id' => 'opt-color-3',
2001 'type' => 'color',
2002 'title' => 'Color with default (rgba)',
2003 'default' => 'rgba(255,255,0,0.25)',
2004 ),
2005
2006 array(
2007 'id' => 'opt-color-4',
2008 'type' => 'color',
2009 'title' => 'Color with default (transparent)',
2010 'default' => 'transparent',
2011 ),
2012
2013 )
2014 ) );
2015
2016 //
2017 // Field: link_color
2018 //
2019 CSF::createSection( $prefix, array(
2020 'parent' => 'color_fields',
2021 'title' => 'Link Color',
2022 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=link-color" target="_blank">Field: link_color</a>',
2023 'fields' => array(
2024
2025 array(
2026 'id' => 'opt-link-color-1',
2027 'type' => 'link_color',
2028 'title' => 'Link Color',
2029 ),
2030
2031 array(
2032 'id' => 'opt-link-color-2',
2033 'type' => 'link_color',
2034 'title' => 'Link Color with default',
2035 'default' => array(
2036 'color' => '#1e73be',
2037 'hover' => '#259ded',
2038 ),
2039 ),
2040
2041 array(
2042 'id' => 'opt-link-color-3',
2043 'type' => 'link_color',
2044 'title' => 'Link Color with more color options',
2045 'color' => true,
2046 'hover' => true,
2047 'visited' => true,
2048 'active' => true,
2049 'focus' => true,
2050 ),
2051
2052 )
2053 ) );
2054
2055 //
2056 // Field: color_group
2057 //
2058 CSF::createSection( $prefix, array(
2059 'parent' => 'color_fields',
2060 'title' => 'Color Group',
2061 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=color-group" target="_blank">Field: color_group</a>',
2062 'fields' => array(
2063
2064 array(
2065 'id' => 'opt-color-group-1',
2066 'type' => 'color_group',
2067 'title' => 'Color Group',
2068 'options' => array(
2069 'color-1' => 'Color 1',
2070 'color-2' => 'Color 2',
2071 )
2072 ),
2073
2074 array(
2075 'id' => 'opt-color-group-2',
2076 'type' => 'color_group',
2077 'title' => 'Color Group',
2078 'options' => array(
2079 'color-1' => 'Color 1',
2080 'color-2' => 'Color 2',
2081 'color-3' => 'Color 3',
2082 )
2083 ),
2084
2085 array(
2086 'id' => 'opt-color-group-3',
2087 'type' => 'color_group',
2088 'title' => 'Color Group with default',
2089 'subtitle' => 'Can be add unlimited color options.',
2090 'options' => array(
2091 'color-1' => 'Color 1',
2092 'color-2' => 'Color 2',
2093 'color-3' => 'Color 3',
2094 'color-4' => 'Color 4',
2095 'color-5' => 'Color 5',
2096 ),
2097 'default' => array(
2098 'color-1' => '#000100',
2099 'color-2' => '#002642',
2100 'color-3' => '#ffce4b',
2101 'color-4' => '#ff595e',
2102 'color-5' => '#0052cc',
2103 )
2104 ),
2105
2106 )
2107 ) );
2108
2109 //
2110 // Field: palette
2111 //
2112 CSF::createSection( $prefix, array(
2113 'parent' => 'color_fields',
2114 'title' => 'Color Palette',
2115 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=palette" target="_blank">Field: palette</a>',
2116 'fields' => array(
2117
2118 array(
2119 'id' => 'opt-palette-1',
2120 'type' => 'palette',
2121 'title' => 'Palette',
2122 'subtitle' => 'Three set colors',
2123 'options' => array(
2124 'set-1' => array( '#f36e27', '#f3d430', '#ed1683' ),
2125 'set-2' => array( '#4153ab', '#6e86c7', '#211f27' ),
2126 'set-3' => array( '#162526', '#508486', '#C8C6CE' ),
2127 'set-4' => array( '#ccab5e', '#fff55f', '#197c5d' ),
2128 ),
2129 'default' => 'set-1',
2130 ),
2131
2132 array(
2133 'id' => 'opt-palette-2',
2134 'type' => 'palette',
2135 'title' => 'Palette',
2136 'subtitle' => 'Four set colors',
2137 'options' => array(
2138 'set-1' => array( '#f04e36', '#f36e27', '#f3d430', '#ed1683' ),
2139 'set-2' => array( '#f9ca06', '#b5b546', '#2f4d48', '#212b2f' ),
2140 'set-3' => array( '#4153ab', '#6e86c7', '#211f27', '#d69762' ),
2141 'set-4' => array( '#162526', '#508486', '#C8C6CE', '#B45F1A' ),
2142 'set-5' => array( '#bbd5ff', '#ccab5e', '#fff55f', '#197c5d' ),
2143 ),
2144 'default' => 'set-3',
2145 ),
2146
2147 array(
2148 'id' => 'opt-palette-3',
2149 'type' => 'palette',
2150 'title' => 'Palette',
2151 'subtitle' => 'Five set colors',
2152 'options' => array(
2153 'set-1' => array( '#bbd5ff', '#ccab5e', '#fff55f', '#197c5d', '#bce2c4' ),
2154 'set-2' => array( '#6d3264', '#edf7f6', '#fde8e9', '#006675', '#e49ab0' ),
2155 'set-3' => array( '#000100', '#002642', '#ffce4b', '#ff595e', '#0052cc' ),
2156 ),
2157 'default' => 'set-1',
2158 ),
2159
2160 )
2161 ) );
2162
2163 //
2164 // Design Fields
2165 //
2166 CSF::createSection( $prefix, array(
2167 'id' => 'design_fields',
2168 'title' => 'Design Fields',
2169 'icon' => 'fas fa-adjust',
2170 ) );
2171
2172 //
2173 // Field: background
2174 //
2175 CSF::createSection( $prefix, array(
2176 'parent' => 'design_fields',
2177 'title' => 'Background',
2178 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=background" target="_blank">Field: background</a>',
2179 'fields' => array(
2180
2181 array(
2182 'id' => 'opt-background-1',
2183 'type' => 'background',
2184 'title' => 'Background',
2185 ),
2186
2187 array(
2188 'id' => 'opt-background-2',
2189 'type' => 'background',
2190 'title' => 'Background with default',
2191 'default' => array(
2192 'background-color' => '#e80000',
2193 'background-position' => 'center center',
2194 'background-repeat' => 'repeat-x',
2195 'background-attachment' => 'fixed',
2196 'background-size' => 'cover',
2197 )
2198 ),
2199
2200 array(
2201 'id' => 'opt-background-3',
2202 'type' => 'background',
2203 'title' => 'Background with all features',
2204 'background_color' => true,
2205 'background_image' => true,
2206 'background-position' => true,
2207 'background_repeat' => true,
2208 'background_attachment' => true,
2209 'background_size' => true,
2210 'background_origin' => true,
2211 'background_clip' => true,
2212 'background_blend_mode' => true,
2213 'background_gradient' => true,
2214 'default' => array(
2215 'background-color' => '#009e44',
2216 'background-gradient-color' => '#81d742',
2217 'background-gradient-direction' => '135deg',
2218 'background-position' => 'center center',
2219 'background-repeat' => 'repeat-x',
2220 'background-attachment' => 'fixed',
2221 'background-size' => 'cover',
2222 'background-origin' => 'border-box',
2223 'background-clip' => 'padding-box',
2224 'background-blend-mode' => 'normal',
2225 )
2226 ),
2227
2228 )
2229 ) );
2230
2231 //
2232 // Field: typography
2233 //
2234 CSF::createSection( $prefix, array(
2235 'parent' => 'design_fields',
2236 'title' => 'Typography',
2237 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=typography" target="_blank">Field: typography</a>',
2238 'fields' => array(
2239
2240 array(
2241 'id' => 'opt-typography-1',
2242 'type' => 'typography',
2243 'title' => 'Typography',
2244 ),
2245
2246 array(
2247 'id' => 'opt-typography-2',
2248 'type' => 'typography',
2249 'title' => 'Typography with default',
2250 'default' => array(
2251 'font-family' => 'Barlow',
2252 'font-weight' => '600',
2253 'subset' => 'latin-ext',
2254 'type' => 'google',
2255 'text-align' => 'center',
2256 'text-transform' => 'capitalize',
2257 'font-size' => '18',
2258 'line-height' => '20',
2259 'letter-spacing' => '-1',
2260 'color' => '#009e44',
2261 ),
2262 ),
2263
2264 array(
2265 'id' => 'opt-typography-3',
2266 'type' => 'typography',
2267 'title' => 'Typography with few features',
2268 'text_align' => false,
2269 'text_transform' => false,
2270 'font_size' => false,
2271 'line_height' => false,
2272 'letter_spacing' => false,
2273 'color' => false,
2274 'default' => array(
2275 'font-family' => 'Lato',
2276 'font-weight' => '900',
2277 'subset' => 'latin',
2278 'type' => 'google',
2279 ),
2280 ),
2281
2282
2283 array(
2284 'id' => 'opt-typography-4',
2285 'type' => 'typography',
2286 'title' => 'Typography with all features',
2287 'font_family' => true,
2288 'font_weight' => true,
2289 'font_style' => true,
2290 'font_size' => true,
2291 'line_height' => true,
2292 'letter_spacing' => true,
2293 'text_align' => true,
2294 'text-transform' => true,
2295 'color' => true,
2296 'subset' => true,
2297 'backup_font_family' => true,
2298 'font_variant' => true,
2299 'word_spacing' => true,
2300 'text_decoration' => true,
2301 'default' => array(
2302 'font-family' => 'Old Standard TT',
2303 'type' => 'google',
2304 ),
2305 ),
2306
2307 )
2308 ) );
2309
2310 //
2311 // Field: dimensions
2312 //
2313 CSF::createSection( $prefix, array(
2314 'parent' => 'design_fields',
2315 'title' => 'Dimensions',
2316 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=dimensions" target="_blank">Field: dimensions</a>',
2317 'fields' => array(
2318
2319 array(
2320 'id' => 'opt-dimensions-1',
2321 'type' => 'dimensions',
2322 'title' => 'Dimensions',
2323 ),
2324
2325 array(
2326 'id' => 'opt-dimensions-2',
2327 'type' => 'dimensions',
2328 'title' => 'Dimensions with default',
2329 'default' => array(
2330 'width' => '100',
2331 'height' => '250',
2332 'unit' => 'px',
2333 ),
2334 ),
2335
2336 array(
2337 'id' => 'opt-dimensions-3',
2338 'type' => 'dimensions',
2339 'title' => 'Dimensions with custom text and units',
2340 'width_icon' => 'width',
2341 'height_icon' => 'height',
2342 'units' => array( 'px', '%', 'em', 'rem', 'pt' ),
2343 'default' => array(
2344 'width' => '100',
2345 'height' => '50',
2346 'unit' => '%',
2347 ),
2348 ),
2349
2350 array(
2351 'id' => 'opt-dimensions-4',
2352 'type' => 'dimensions',
2353 'title' => 'Dimensions with single unit',
2354 'units' => array( 'px' ),
2355 ),
2356
2357 array(
2358 'id' => 'opt-dimensions-5',
2359 'type' => 'dimensions',
2360 'title' => 'Dimensions without unit selector',
2361 'unit' => false,
2362 ),
2363
2364 array(
2365 'id' => 'opt-dimensions-6',
2366 'type' => 'dimensions',
2367 'title' => 'Dimensions with only width',
2368 'height' => false,
2369 ),
2370
2371 array(
2372 'id' => 'opt-dimensions-7',
2373 'type' => 'dimensions',
2374 'title' => 'Dimensions with only width and single unit',
2375 'height' => false,
2376 'units' => array( 'px' ),
2377 ),
2378
2379 )
2380 ) );
2381
2382 //
2383 // Field: spacing
2384 //
2385 CSF::createSection( $prefix, array(
2386 'parent' => 'design_fields',
2387 'title' => 'Spacing',
2388 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=spacing" target="_blank">Field: spacing</a>',
2389 'fields' => array(
2390
2391 array(
2392 'id' => 'opt-spacing-1',
2393 'type' => 'spacing',
2394 'title' => 'Spacing',
2395 ),
2396
2397 array(
2398 'id' => 'opt-spacing-2',
2399 'type' => 'spacing',
2400 'title' => 'Spacing with default',
2401 'default' => array(
2402 'top' => '50',
2403 'right' => '100',
2404 'bottom' => '50',
2405 'left' => '100',
2406 'unit' => 'px',
2407 ),
2408 ),
2409
2410 array(
2411 'id' => 'opt-spacing-2',
2412 'type' => 'spacing',
2413 'title' => 'Spacing without unit selector',
2414 'units' => array( 'px' ),
2415 'default' => array(
2416 'top' => '50',
2417 'right' => '100',
2418 'bottom' => '50',
2419 'left' => '100',
2420 'unit' => 'px',
2421 ),
2422 ),
2423
2424 array(
2425 'id' => 'opt-spacing-3',
2426 'type' => 'spacing',
2427 'title' => 'Spacing with only left and right',
2428 'top' => false,
2429 'bottom' => false,
2430 ),
2431
2432 array(
2433 'id' => 'opt-spacing-4',
2434 'type' => 'spacing',
2435 'title' => 'Spacing with only top and bottom',
2436 'left' => false,
2437 'right' => false,
2438 ),
2439
2440 array(
2441 'id' => 'opt-spacing-5',
2442 'type' => 'spacing',
2443 'title' => 'Spacing with all directions',
2444 'all' => true,
2445 ),
2446
2447 )
2448 ) );
2449
2450 //
2451 // Field: border
2452 //
2453 CSF::createSection( $prefix, array(
2454 'parent' => 'design_fields',
2455 'title' => 'Border',
2456 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=border" target="_blank">Field: border</a>',
2457 'fields' => array(
2458
2459 array(
2460 'id' => 'opt-border-1',
2461 'type' => 'border',
2462 'title' => 'Border',
2463 ),
2464
2465 array(
2466 'id' => 'opt-border-2',
2467 'type' => 'border',
2468 'title' => 'Border with default',
2469 'default' => array(
2470 'top' => '4',
2471 'right' => '8',
2472 'bottom' => '4',
2473 'left' => '8',
2474 'style' => 'dashed',
2475 'color' => '#1e73be',
2476 )
2477 ),
2478
2479 array(
2480 'id' => 'opt-border-3',
2481 'type' => 'border',
2482 'title' => 'Border with only left and right',
2483 'top' => false,
2484 'bottom' => false,
2485 ),
2486
2487 array(
2488 'id' => 'opt-border-4',
2489 'type' => 'border',
2490 'title' => 'Border with only top and bottom',
2491 'left' => false,
2492 'right' => false,
2493 ),
2494
2495 array(
2496 'id' => 'opt-border-5',
2497 'type' => 'border',
2498 'title' => 'Border with all directions',
2499 'all' => true,
2500 ),
2501
2502 )
2503 ) );
2504
2505 //
2506 // Field: spinner
2507 //
2508 CSF::createSection( $prefix, array(
2509 'parent' => 'design_fields',
2510 'title' => 'Spinner',
2511 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=spinner" target="_blank">Field: spinner</a>',
2512 'fields' => array(
2513
2514 array(
2515 'id' => 'opt-spinner-1',
2516 'type' => 'spinner',
2517 'title' => 'Spinner',
2518 'subtitle' => 'max:100 | min:0 | step:1',
2519 'max' => 100,
2520 'min' => 0,
2521 'step' => 1,
2522 'default' => 25,
2523 ),
2524
2525 array(
2526 'id' => 'opt-spinner-2',
2527 'type' => 'spinner',
2528 'title' => 'Spinner',
2529 'subtitle' => 'max:200 | min:100 | step:10',
2530 'max' => 200,
2531 'min' => 100,
2532 'step' => 10,
2533 'default' => 100,
2534 ),
2535
2536 array(
2537 'id' => 'opt-spinner-3',
2538 'type' => 'spinner',
2539 'title' => 'Spinner',
2540 'subtitle' => 'max:1 | min:0 | step:0.1 | unit:px',
2541 'max' => 1,
2542 'min' => 0,
2543 'step' => 0.1,
2544 'unit' => 'px',
2545 'default' => 0.5,
2546 ),
2547
2548 )
2549 ) );
2550
2551 //
2552 // Field: number
2553 //
2554 CSF::createSection( $prefix, array(
2555 'parent' => 'design_fields',
2556 'title' => 'Number',
2557 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=number" target="_blank">Field: number</a>',
2558 'fields' => array(
2559
2560 array(
2561 'id' => 'opt-number-1',
2562 'type' => 'number',
2563 'title' => 'Number',
2564 ),
2565 array(
2566 'id' => 'opt-number-2',
2567 'type' => 'number',
2568 'title' => 'Number with unit',
2569 'unit' => 'px',
2570 ),
2571 array(
2572 'id' => 'opt-number-3',
2573 'type' => 'number',
2574 'title' => 'Number with default',
2575 'unit' => 'width',
2576 'default' => 100,
2577 ),
2578
2579 )
2580 ) );
2581
2582 //
2583 // Additional Fields
2584 //
2585 CSF::createSection( $prefix, array(
2586 'id' => 'additional_fields',
2587 'title' => 'Additional Fields',
2588 'icon' => 'fas fa-asterisk',
2589 ) );
2590
2591 //
2592 // Field: slider
2593 //
2594 CSF::createSection( $prefix, array(
2595 'parent' => 'additional_fields',
2596 'title' => 'Slider',
2597 'icon' => 'fas fa-sliders-h',
2598 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=slider" target="_blank">Field: slider</a>',
2599 'fields' => array(
2600
2601 array(
2602 'id' => 'opt-slider-1',
2603 'type' => 'slider',
2604 'title' => 'Slider',
2605 ),
2606
2607 array(
2608 'id' => 'opt-slider-2',
2609 'type' => 'slider',
2610 'title' => 'Slider with default',
2611 'default' => 50,
2612 ),
2613
2614 array(
2615 'id' => 'opt-slider-3',
2616 'type' => 'slider',
2617 'title' => 'Slider with unit text',
2618 'unit' => '%',
2619 'default' => 75,
2620 ),
2621
2622 array(
2623 'id' => 'opt-slider-4',
2624 'type' => 'slider',
2625 'title' => 'Slider with min/max allowed value',
2626 'subtitle' => 'Min: 1 | Max: 10 | Step: 0.1 | Default: 5.5',
2627 'unit' => 'px',
2628 'min' => 1,
2629 'max' => 10,
2630 'step' => 0.1,
2631 'default' => 5.5,
2632 ),
2633
2634 )
2635 ) );
2636
2637 //
2638 // Field: sorter
2639 //
2640 CSF::createSection( $prefix, array(
2641 'parent' => 'additional_fields',
2642 'title' => 'Sorter',
2643 'icon' => 'fas fa-sort-numeric-down',
2644 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=sorter" target="_blank">Field: sorter</a>',
2645 'fields' => array(
2646
2647 array(
2648 'id' => 'opt-sorter-1',
2649 'type' => 'sorter',
2650 'title' => 'Sorter',
2651 'default' => array(
2652 'enabled' => array(
2653 'opt-1' => 'Option 1',
2654 'opt-2' => 'Option 2',
2655 'opt-3' => 'Option 3',
2656 ),
2657 'disabled' => array(
2658 'opt-4' => 'Option 4',
2659 'opt-5' => 'Option 5',
2660 ),
2661 ),
2662 ),
2663
2664 array(
2665 'id' => 'opt-sorter-2',
2666 'type' => 'sorter',
2667 'title' => 'Sorter with custom title',
2668 'enabled_title' => 'Activated',
2669 'disabled_title' => 'Deactivated',
2670 'default' => array(
2671 'enabled' => array(
2672 'opt-1' => 'Option 1',
2673 'opt-2' => 'Option 2',
2674 'opt-3' => 'Option 3',
2675 ),
2676 'disabled' => array(
2677 'opt-4' => 'Option 4',
2678 'opt-5' => 'Option 5',
2679 ),
2680 ),
2681 ),
2682
2683 array(
2684 'id' => 'opt-sorter-3',
2685 'type' => 'sorter',
2686 'title' => 'Sorter with use only enabled section and without title',
2687 'enabled_title' => false,
2688 'disabled' => false,
2689 'default' => array(
2690 'enabled' => array(
2691 'opt-1' => 'Option 1',
2692 'opt-2' => 'Option 2',
2693 'opt-3' => 'Option 3',
2694 ),
2695 ),
2696 ),
2697
2698 )
2699 ) );
2700
2701 //
2702 // Field: sortable
2703 //
2704 CSF::createSection( $prefix, array(
2705 'parent' => 'additional_fields',
2706 'title' => 'Sortable',
2707 'icon' => 'fas fa-arrows-alt',
2708 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=sortable" target="_blank">Field: sortable</a>',
2709 'fields' => array(
2710
2711 array(
2712 'id' => 'opt-sortable-1',
2713 'type' => 'sortable',
2714 'title' => 'Sortable',
2715 'fields' => array(
2716 array(
2717 'id' => 'opt-text-1',
2718 'type' => 'text',
2719 'title' => 'Text 1'
2720 ),
2721 array(
2722 'id' => 'opt-text-2',
2723 'type' => 'text',
2724 'title' => 'Text 2'
2725 ),
2726 array(
2727 'id' => 'opt-text-3',
2728 'type' => 'text',
2729 'title' => 'Text 3'
2730 ),
2731 ),
2732 ),
2733
2734 array(
2735 'id' => 'opt-sortable-2',
2736 'type' => 'sortable',
2737 'title' => 'Sortable with default',
2738 'fields' => array(
2739 array(
2740 'id' => 'opt-text-1',
2741 'type' => 'text',
2742 'title' => 'Text 1'
2743 ),
2744 array(
2745 'id' => 'opt-text-2',
2746 'type' => 'text',
2747 'title' => 'Text 2'
2748 ),
2749 array(
2750 'id' => 'opt-text-3',
2751 'type' => 'text',
2752 'title' => 'Text 3'
2753 ),
2754 ),
2755 'default' => array(
2756 'opt-text-1' => 'This is text 1 default',
2757 'opt-text-2' => 'This is text 2 default',
2758 'opt-text-3' => 'This is text 3 default',
2759 )
2760 ),
2761
2762 )
2763 ) );
2764
2765 //
2766 // Field: switcher
2767 //
2768 CSF::createSection( $prefix, array(
2769 'parent' => 'additional_fields',
2770 'title' => 'Switcher',
2771 'icon' => 'fas fa-toggle-on',
2772 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=switcher" target="_blank">Field: switcher</a>',
2773 'fields' => array(
2774
2775 array(
2776 'id' => 'opt-switcher-1',
2777 'type' => 'switcher',
2778 'title' => 'Switcher',
2779 ),
2780
2781 array(
2782 'id' => 'opt-switcher-2',
2783 'type' => 'switcher',
2784 'title' => 'Switcher with default',
2785 'default' => true,
2786 ),
2787
2788 array(
2789 'id' => 'opt-switcher-3',
2790 'type' => 'switcher',
2791 'title' => 'Switcher with label',
2792 'label' => 'The label text of the switcher.',
2793 ),
2794
2795 array(
2796 'id' => 'opt-switcher-4',
2797 'type' => 'switcher',
2798 'title' => 'Switcher with Yes/No',
2799 'text_on' => 'Yes',
2800 'text_off' => 'No',
2801 ),
2802
2803 array(
2804 'id' => 'opt-switcher-4',
2805 'type' => 'switcher',
2806 'title' => 'Switcher with custom text Enabled/Disabled',
2807 'text_on' => 'Enabled',
2808 'text_off' => 'Disabled',
2809 'text_width' => '100',
2810 ),
2811
2812 )
2813 ) );
2814
2815 //
2816 // Field: icons
2817 //
2818 CSF::createSection( $prefix, array(
2819 'parent' => 'additional_fields',
2820 'title' => 'Icons',
2821 'icon' => 'fas fa-star',
2822 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=icon" target="_blank">Field: icon</a>',
2823 'fields' => array(
2824
2825 array(
2826 'id' => 'opt-icon-1',
2827 'type' => 'icon',
2828 'title' => 'Icon',
2829 ),
2830
2831 array(
2832 'id' => 'opt-icon-2',
2833 'type' => 'icon',
2834 'title' => 'Icon with default',
2835 'default' => 'fas fa-check',
2836 ),
2837
2838 )
2839 ) );
2840
2841 //
2842 // Field: map
2843 //
2844 CSF::createSection( $prefix, array(
2845 'parent' => 'additional_fields',
2846 'title' => 'Map',
2847 'icon' => 'fas fa-map-marker',
2848 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=map" target="_blank">Field: map</a>',
2849 'fields' => array(
2850
2851 array(
2852 'id' => 'opt-map-1',
2853 'type' => 'map',
2854 'title' => 'Map',
2855 ),
2856
2857 array(
2858 'id' => 'opt-map-2',
2859 'type' => 'map',
2860 'title' => 'Map with Default',
2861 'default' => array(
2862 'address' => 'New York, United States of America',
2863 'latitude' => '40.7127281',
2864 'longitude' => '-74.0060152',
2865 'zoom' => '12',
2866 )
2867 ),
2868
2869 array(
2870 'type' => 'submessage',
2871 'style' => 'info',
2872 'content' => 'Using custom <strong>address_field</strong> field in below example.',
2873 ),
2874
2875 array(
2876 'id' => 'my-address-text',
2877 'type' => 'text',
2878 'title' => 'Address',
2879 ),
2880
2881 array(
2882 'id' => 'opt-map-3',
2883 'type' => 'map',
2884 'title' => 'Map',
2885 'desc' => 'Using custom <strong>address_field</strong> field',
2886 'address_field' => 'my-address-text',
2887 ),
2888
2889 )
2890 ) );
2891
2892 //
2893 // Field: link
2894 //
2895 CSF::createSection( $prefix, array(
2896 'parent' => 'additional_fields',
2897 'title' => 'Link',
2898 'icon' => 'fas fa-link',
2899 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=link" target="_blank">Field: link</a>',
2900 'fields' => array(
2901
2902 array(
2903 'id' => 'opt-link-1',
2904 'type' => 'link',
2905 'title' => 'Link',
2906 ),
2907
2908 array(
2909 'id' => 'opt-link-2',
2910 'type' => 'link',
2911 'title' => 'Link with default',
2912 'default' => array(
2913 'url' => 'http://codestarframework.com/',
2914 'text' => 'Codestar Framework',
2915 'target' => '_blank'
2916 ),
2917 ),
2918
2919 )
2920 ) );
2921
2922 //
2923 // Field: date
2924 //
2925 CSF::createSection( $prefix, array(
2926 'parent' => 'additional_fields',
2927 'title' => 'Date',
2928 'icon' => 'fas fa-calendar',
2929 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=date" target="_blank">Field: date</a>',
2930 'fields' => array(
2931
2932 array(
2933 'id' => 'opt-date-1',
2934 'type' => 'date',
2935 'title' => 'Date',
2936 ),
2937
2938 array(
2939 'id' => 'opt-date-2',
2940 'type' => 'date',
2941 'title' => 'Date with custom settings',
2942 'settings' => array(
2943 'dateFormat' => 'mm/dd/yy',
2944 'changeMonth' => true,
2945 'changeYear' => true,
2946 'showWeek' => true,
2947 'showButtonPanel' => true,
2948 'weekHeader' => 'Week',
2949 'monthNamesShort' => array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ),
2950 'dayNamesMin' => array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ),
2951 )
2952 ),
2953
2954 array(
2955 'id' => 'opt-date-3',
2956 'type' => 'date',
2957 'title' => 'Date with From &amp; To',
2958 'from_to' => true,
2959 ),
2960
2961 array(
2962 'id' => 'opt-date-4',
2963 'type' => 'date',
2964 'title' => 'Date with custom texts Begin &amp; End',
2965 'from_to' => true,
2966 'text_from' => 'Begin',
2967 'text_to' => 'End',
2968 ),
2969
2970 )
2971 ) );
2972
2973 //
2974 // Field: datetime
2975 //
2976 CSF::createSection( $prefix, array(
2977 'parent' => 'additional_fields',
2978 'title' => 'Date and Time',
2979 'icon' => 'fas fa-calendar',
2980 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=date-time" target="_blank">Field: datetime</a>',
2981 'fields' => array(
2982
2983 array(
2984 'id' => 'opt-datetime-1',
2985 'type' => 'datetime',
2986 'title' => 'Date',
2987 ),
2988
2989 array(
2990 'id' => 'opt-datetime-2',
2991 'type' => 'datetime',
2992 'title' => 'Date',
2993 'subtitle' => 'Human-friendly Dates',
2994 'settings' => array(
2995 'altFormat' => 'F j, Y',
2996 'dateFormat' => 'Y-m-d',
2997 ),
2998 ),
2999
3000 array(
3001 'id' => 'opt-datetime-3',
3002 'type' => 'datetime',
3003 'title' => 'Date',
3004 'subtitle' => 'Start week on Monday',
3005 'settings' => array(
3006 'locale' => array(
3007 'firstDayOfWeek' => 1,
3008 ),
3009 ),
3010 ),
3011
3012 array(
3013 'id' => 'opt-datetime-4',
3014 'type' => 'datetime',
3015 'title' => 'Date and Time',
3016 'subtitle' => 'Date and Time Both',
3017 'settings' => array(
3018 'enableTime' => true,
3019 'dateFormat' => 'Y-m-d H:i',
3020 ),
3021 ),
3022
3023 array(
3024 'id' => 'opt-datetime-5',
3025 'type' => 'datetime',
3026 'title' => 'Time',
3027 'subtitle' => 'Only Time',
3028 'settings' => array(
3029 'noCalendar' => true,
3030 'enableTime' => true,
3031 ),
3032 ),
3033
3034 array(
3035 'id' => 'opt-datetime-6',
3036 'type' => 'datetime',
3037 'title' => 'Time',
3038 'subtitle' => '24-hour Time without PM:AM',
3039 'settings' => array(
3040 'noCalendar' => true,
3041 'enableTime' => true,
3042 'dateFormat' => 'H:i',
3043 'time_24hr' => true,
3044 ),
3045 ),
3046
3047 array(
3048 'id' => 'opt-datetime-7',
3049 'type' => 'datetime',
3050 'title' => 'Date Range',
3051 'subtitle' => 'Range Mode',
3052 'settings' => array(
3053 'mode' => 'range',
3054 ),
3055 ),
3056
3057 array(
3058 'id' => 'opt-datetime-8',
3059 'type' => 'datetime',
3060 'title' => 'Date From - To',
3061 'subtitle' => 'Date with "From" and "To"',
3062 'from_to' => true,
3063 ),
3064
3065 array(
3066 'id' => 'opt-datetime-9',
3067 'type' => 'datetime',
3068 'title' => 'Date Begin - End',
3069 'subtitle' => 'Date with "Begin" and "End" Custom Text',
3070 'from_to' => true,
3071 'text_from' => 'Begin',
3072 'text_to' => 'End',
3073 ),
3074
3075 array(
3076 'id' => 'opt-datetime-10',
3077 'type' => 'datetime',
3078 'title' => 'Date',
3079 'subtitle' => 'Localize Example (Spanish)',
3080 'settings' => array(
3081 'locale' => array(
3082 'time_24hr' => true,
3083 'firstDayOfWeek' => 1,
3084 'weekdays' => array(
3085 'shorthand' => array( 'Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb' ),
3086 'longhand' => array(
3087 'Domingo',
3088 'Lunes',
3089 'Martes',
3090 'Miércoles',
3091 'Jueves',
3092 'Viernes',
3093 'Sábado',
3094 ),
3095 ),
3096 'months' => array(
3097 'shortland' => array( 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ),
3098 'longhand' => array(
3099 'Enero',
3100 'Febrero',
3101 'Marzo',
3102 'Abril',
3103 'Mayo',
3104 'Junio',
3105 'Julio',
3106 'Agosto',
3107 'Septiembre',
3108 'Octubre',
3109 'Noviembre',
3110 'Diciembre',
3111 ),
3112 ),
3113 ),
3114 ),
3115 ),
3116
3117 array(
3118 'id' => 'opt-datetime-11',
3119 'type' => 'datetime',
3120 'title' => 'Date',
3121 'subtitle' => 'Ready-Only Input',
3122 'settings' => array(
3123 'allowInput' => false,
3124 ),
3125 ),
3126
3127 )
3128 ) );
3129
3130 //
3131 // Field: image_select
3132 //
3133 CSF::createSection( $prefix, array(
3134 'parent' => 'additional_fields',
3135 'title' => 'Image Select',
3136 'icon' => 'fas fa-th',
3137 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=image-select" target="_blank">Field: image_select</a>',
3138 'fields' => array(
3139
3140 array(
3141 'id' => 'opt-image-select-1',
3142 'type' => 'image_select',
3143 'title' => 'Image Select',
3144 'options' => array(
3145 'opt-1' => 'http://codestarframework.com/assets/images/placeholder/150x125-2ecc71.gif',
3146 'opt-2' => 'http://codestarframework.com/assets/images/placeholder/150x125-e74c3c.gif',
3147 'opt-3' => 'http://codestarframework.com/assets/images/placeholder/150x125-ffbc00.gif',
3148 'opt-4' => 'http://codestarframework.com/assets/images/placeholder/150x125-3498db.gif',
3149 ),
3150 ),
3151
3152 array(
3153 'id' => 'opt-image-select-2',
3154 'type' => 'image_select',
3155 'title' => 'Image Select with default',
3156 'options' => array(
3157 'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3158 'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3159 'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3160 'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3161 'opt-5' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3162 'opt-6' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3163 'opt-7' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3164 ),
3165 'default' => 'opt-4'
3166 ),
3167
3168 array(
3169 'id' => 'opt-image-select-3',
3170 'type' => 'image_select',
3171 'title' => 'Image Select with multiple choice',
3172 'multiple' => true,
3173 'options' => array(
3174 'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-e74c3c.gif',
3175 'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-ffbc00.gif',
3176 'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-3498db.gif',
3177 'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-2ecc71.gif',
3178 ),
3179 ),
3180
3181 array(
3182 'id' => 'opt-image-select-4',
3183 'type' => 'image_select',
3184 'title' => 'Image Select with multiple choice and default',
3185 'multiple' => true,
3186 'options' => array(
3187 'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3188 'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3189 'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-e74c3c.gif',
3190 'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-ffbc00.gif',
3191 'opt-5' => 'http://codestarframework.com/assets/images/placeholder/80x80-3498db.gif',
3192 'opt-6' => 'http://codestarframework.com/assets/images/placeholder/80x80-2ecc71.gif',
3193 'opt-7' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3194 'opt-8' => 'http://codestarframework.com/assets/images/placeholder/80x80-2c3e50.gif',
3195 ),
3196 'default' => array( 'opt-3', 'opt-4', 'opt-5', 'opt-6' )
3197 ),
3198
3199 array(
3200 'id' => 'opt-image-select-5',
3201 'type' => 'image_select',
3202 'title' => 'Image Select inline style',
3203 'inline' => true,
3204 'options' => array(
3205 'opt-1' => 'http://codestarframework.com/assets/images/placeholder/80x80-e74c3c.gif',
3206 'opt-2' => 'http://codestarframework.com/assets/images/placeholder/80x80-ffbc00.gif',
3207 'opt-3' => 'http://codestarframework.com/assets/images/placeholder/80x80-3498db.gif',
3208 'opt-4' => 'http://codestarframework.com/assets/images/placeholder/80x80-2ecc71.gif',
3209 ),
3210 'default' => 'opt-1'
3211 ),
3212
3213 )
3214 ) );
3215
3216 //
3217 // Field: button_set
3218 //
3219 CSF::createSection( $prefix, array(
3220 'parent' => 'additional_fields',
3221 'title' => 'Button Set',
3222 'icon' => 'fas fa-ellipsis-h',
3223 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=button-set" target="_blank">Field: button_set</a>',
3224 'fields' => array(
3225
3226 array(
3227 'id' => 'opt-button-set-1',
3228 'type' => 'button_set',
3229 'title' => 'Button Set',
3230 'options' => array(
3231 'enabled' => 'Enabled',
3232 'disabled' => 'Disabled',
3233 ),
3234 ),
3235
3236 array(
3237 'id' => 'opt-button-set-2',
3238 'type' => 'button_set',
3239 'title' => 'Button Set with default',
3240 'options' => array(
3241 'enabled' => 'Enabled',
3242 '' => 'Default',
3243 'disabled' => 'Disabled',
3244 ),
3245 ),
3246
3247 array(
3248 'id' => 'opt-button-set-3',
3249 'type' => 'button_set',
3250 'title' => 'Button Set',
3251 'options' => array(
3252 'activate' => 'Activate',
3253 'deactivate' => 'Deactivate',
3254 ),
3255 'default' => 'activate',
3256 ),
3257
3258 array(
3259 'id' => 'opt-button-set-4',
3260 'type' => 'button_set',
3261 'title' => 'Button Set',
3262 'options' => array(
3263 'on' => 'ON',
3264 'off' => 'OFF',
3265 ),
3266 'default' => 'on',
3267 ),
3268
3269 array(
3270 'id' => 'opt-button-set-5',
3271 'type' => 'button_set',
3272 'title' => 'Button Set with multiple choice',
3273 'multiple' => true,
3274 'options' => array(
3275 'opt-1' => 'Option 1',
3276 'opt-2' => 'Option 2',
3277 'opt-3' => 'Option 3',
3278 'opt-4' => 'Option 4',
3279 'opt-5' => 'Option 5',
3280 ),
3281 ),
3282
3283 array(
3284 'id' => 'opt-button-set-6',
3285 'type' => 'button_set',
3286 'title' => 'Button Set with multiple choice and default',
3287 'multiple' => true,
3288 'options' => array(
3289 'opt-1' => 'Option 1',
3290 'opt-2' => 'Option 2',
3291 'opt-3' => 'Option 3',
3292 'opt-4' => 'Option 4',
3293 'opt-5' => 'Option 5',
3294 ),
3295 'default' => array( 'opt-2', 'opt-4' )
3296 ),
3297
3298 array(
3299 'id' => 'opt-button-set-7',
3300 'type' => 'button_set',
3301 'title' => 'Button Set with categories',
3302 'options' => 'categories',
3303 ),
3304
3305 array(
3306 'id' => 'opt-button-set-8',
3307 'type' => 'button_set',
3308 'title' => 'Button Set with tags',
3309 'options' => 'tags',
3310 ),
3311
3312 )
3313 ) );
3314
3315 //
3316 // Dependencies
3317 //
3318 CSF::createSection( $prefix, array(
3319 'title' => 'Dependencies',
3320 'icon' => 'fas fa-code-branch',
3321 'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/faq?id=how-to-use-dependency" target="_blank">How to use dependencies</a>',
3322 'fields' => array(
3323
3324 array(
3325 'type' => 'subheading',
3326 'content' => 'Basic Dependencies',
3327 ),
3328
3329 //
3330 // Dependency example 1
3331 array(
3332 'id' => 'opt-depend-switcher',
3333 'type' => 'switcher',
3334 'title' => 'If switched to (ON)',
3335 ),
3336
3337 array(
3338 'type' => 'notice',
3339 'style' => 'success',
3340 'content' => 'Success: Switched to (ON).',
3341 'dependency' => array( 'opt-depend-switcher', '==', 'true' ),
3342 ),
3343
3344 //
3345 // Dependency example 2
3346 array(
3347 'id' => 'opt-depend-text',
3348 'type' => 'text',
3349 'title' => 'If typed something to field',
3350 ),
3351
3352 array(
3353 'type' => 'notice',
3354 'style' => 'success',
3355 'content' => 'Success: You typed something.',
3356 'dependency' => array( 'opt-depend-text', '!=', '' ),
3357 ),
3358
3359 //
3360 // Dependency example 3
3361 array(
3362 'id' => 'opt-depend-select',
3363 'type' => 'select',
3364 'title' => 'If selected to (Blue) or (Black)',
3365 'placeholder' => 'Select a color',
3366 'options' => array(
3367 'blue' => 'Blue',
3368 'yellow' => 'Yellow',
3369 'green' => 'Green',
3370 'black' => 'Black',
3371 'white' => 'White',
3372 ),
3373 ),
3374
3375 array(
3376 'type' => 'notice',
3377 'style' => 'success',
3378 'content' => 'Success: Selected to (Blue) or (Black).',
3379 'dependency' => array( 'opt-depend-select', 'any', 'blue,black' ),
3380 ),
3381
3382 //
3383 // Dependency example 4
3384 array(
3385 'id' => 'opt-depend-radio',
3386 'type' => 'radio',
3387 'title' => 'If selected to (Yes, Please)',
3388 'inline' => true,
3389 'options' => array(
3390 'no' => 'No, Thanks',
3391 'yes' => 'Yes, Please',
3392 'any' => 'I am not sure!',
3393 ),
3394 'default' => 'no'
3395 ),
3396
3397 array(
3398 'type' => 'notice',
3399 'style' => 'success',
3400 'content' => 'Success: Selected to (Yes, Please).',
3401 'dependency' => array( 'opt-depend-radio', '==', 'yes' ),
3402 ),
3403
3404 //
3405 // Dependency example 5
3406 array(
3407 'id' => 'opt-depend-checkbox',
3408 'type' => 'checkbox',
3409 'title' => 'If selected to (Green) or (Black)',
3410 'inline' => true,
3411 'options' => array(
3412 'blue' => 'Blue',
3413 'yellow' => 'Yellow',
3414 'green' => 'Green',
3415 'black' => 'Black',
3416 'white' => 'White',
3417 ),
3418 ),
3419
3420 array(
3421 'type' => 'notice',
3422 'style' => 'success',
3423 'content' => 'Success: Selected to (Green).',
3424 'dependency' => array( 'opt-depend-checkbox', 'any', 'green,black' ),
3425 ),
3426
3427 //
3428 // Dependency example 6
3429 array(
3430 'id' => 'opt-depend-image-select',
3431 'type' => 'image_select',
3432 'title' => 'If selected to (Blue) box',
3433 'options' => array(
3434 'green' => 'http://codestarframework.com/assets/images/placeholder/100x80-2ecc71.gif',
3435 'red' => 'http://codestarframework.com/assets/images/placeholder/100x80-e74c3c.gif',
3436 'yellow' => 'http://codestarframework.com/assets/images/placeholder/100x80-ffbc00.gif',
3437 'blue' => 'http://codestarframework.com/assets/images/placeholder/100x80-3498db.gif',
3438 'gray' => 'http://codestarframework.com/assets/images/placeholder/100x80-555555.gif',
3439 ),
3440 'default' => 'green',
3441 ),
3442
3443 array(
3444 'type' => 'notice',
3445 'style' => 'success',
3446 'content' => 'Success: Selected to (Blue) box.',
3447 'dependency' => array( 'opt-depend-image-select', '==', 'blue' ),
3448 ),
3449
3450 //
3451 // Dependency example 6
3452 array(
3453 'id' => 'opt-depend-image-select-any',
3454 'type' => 'image_select',
3455 'title' => 'If selected to (Red) or (Blue) box',
3456 'options' => array(
3457 'green' => 'http://codestarframework.com/assets/images/placeholder/100x80-2ecc71.gif',
3458 'red' => 'http://codestarframework.com/assets/images/placeholder/100x80-e74c3c.gif',
3459 'yellow' => 'http://codestarframework.com/assets/images/placeholder/100x80-ffbc00.gif',
3460 'blue' => 'http://codestarframework.com/assets/images/placeholder/100x80-3498db.gif',
3461 'gray' => 'http://codestarframework.com/assets/images/placeholder/100x80-555555.gif',
3462 ),
3463 'default' => 'green',
3464 ),
3465
3466 array(
3467 'type' => 'notice',
3468 'style' => 'success',
3469 'content' => 'Success: Selected to (Red) or (Blue) box.',
3470 'dependency' => array( 'opt-depend-image-select-any', 'any', 'red,blue' ),
3471 ),
3472
3473 array(
3474 'type' => 'subheading',
3475 'content' => 'Visible Dependencies',
3476 ),
3477
3478 //
3479 // Dependency example 7
3480 array(
3481 'id' => 'opt-depend-visible-switcher',
3482 'type' => 'switcher',
3483 'title' => 'Switched to (ON)',
3484 'label' => 'Below fields are visibling instead of hiding. Switched to (ON) for use them.',
3485 ),
3486
3487 array(
3488 'id' => 'opt-depend-visible-text',
3489 'type' => 'text',
3490 'title' => 'Visible Text',
3491 'dependency' => array( 'opt-depend-visible-switcher', '==', 'true', '', 'visible' ),
3492 ),
3493
3494 array(
3495 'id' => 'opt-depend-visible-select',
3496 'type' => 'select',
3497 'title' => 'Visible Select',
3498 'placeholder' => 'Select an option',
3499 'options' => array(
3500 'opt-1' => 'Option 1',
3501 'opt-2' => 'Option 2',
3502 'opt-3' => 'Option 3',
3503 ),
3504 'dependency' => array( 'opt-depend-visible-switcher', '==', 'true', '', 'visible' ),
3505 ),
3506
3507 //
3508 // Dependency example 8
3509 array(
3510 'type' => 'subheading',
3511 'content' => 'Nested Dependencies',
3512 ),
3513
3514 array(
3515 'id' => 'opt-depend-switcher-1',
3516 'type' => 'switcher',
3517 'title' => 'If switched to (ON) --->',
3518 ),
3519
3520 array(
3521 'id' => 'opt-depend-select-1',
3522 'type' => 'select',
3523 'title' => '---> and selected to (Blue)',
3524 'placeholder' => 'Select a color',
3525 'options' => array(
3526 'blue' => 'Blue',
3527 'yellow' => 'Yellow',
3528 'green' => 'Green',
3529 'black' => 'Black',
3530 'white' => 'White',
3531 ),
3532 ),
3533
3534 array(
3535 'type' => 'notice',
3536 'style' => 'success',
3537 'content' => 'Success: Switched to (ON) and selected to (Blue).',
3538 'dependency' => array( 'opt-depend-switcher-1|opt-depend-select-1', '==|==', 'true|blue' ),
3539 ),
3540
3541 //
3542 // Dependency example 9
3543 array(
3544 'type' => 'subheading',
3545 'content' => 'Another Nested Dependencies',
3546 ),
3547
3548 array(
3549 'id' => 'opt-nested-select-1',
3550 'type' => 'select',
3551 'title' => 'If selected to (Black) or (White) --->',
3552 'placeholder' => 'Select a color',
3553 'options' => array(
3554 'blue' => 'Blue',
3555 'yellow' => 'Yellow',
3556 'green' => 'Green',
3557 'black' => 'Black',
3558 'white' => 'White',
3559 ),
3560 ),
3561
3562 array(
3563 'id' => 'opt-nested-select-2',
3564 'type' => 'select',
3565 'title' => '---> and selected to (Large) --->',
3566 'placeholder' => 'Select a size',
3567 'options' => array(
3568 'small' => 'Small',
3569 'middle' => 'Middle',
3570 'large' => 'Large',
3571 'xlage' => 'XLarge',
3572 'xxlage' => 'XXLarge',
3573 ),
3574 'dependency' => array( 'opt-nested-select-1', 'any', 'black,white' ),
3575 ),
3576
3577 array(
3578 'id' => 'opt-nested-select-3',
3579 'type' => 'select',
3580 'title' => '---> and selected to (Hello)',
3581 'placeholder' => 'Select a word',
3582 'options' => array(
3583 'hello' => 'Hello',
3584 'world' => 'World',
3585 ),
3586 'dependency' => array( 'opt-nested-select-1|opt-nested-select-2', 'any|==', 'black,white|large' ),
3587 ),
3588
3589 array(
3590 'type' => 'notice',
3591 'style' => 'success',
3592 'content' => 'Congratulations, You are here now!',
3593 'dependency' => array( 'opt-nested-select-1|opt-nested-select-2|opt-nested-select-3', 'any|==|==', 'black,white|large|hello' ),
3594 ),
3595
3596 //
3597 // Dependency example 10
3598 array(
3599 'type' => 'subheading',
3600 'content' => 'Contains Dependencies',
3601 ),
3602
3603 array(
3604 'id' => 'opt-depend-checkbox-1',
3605 'type' => 'checkbox',
3606 'title' => 'Select a color or more.',
3607 'inline' => true,
3608 'options' => array(
3609 'blue' => 'Blue',
3610 'yellow' => 'Yellow',
3611 'green' => 'Green',
3612 ),
3613 ),
3614
3615 array(
3616 'type' => 'notice',
3617 'style' => 'info',
3618 'content' => 'Selected (blue) color.',
3619 'dependency' => array( 'opt-depend-checkbox-1', 'contains', 'blue' ),
3620 ),
3621
3622 array(
3623 'type' => 'notice',
3624 'style' => 'warning',
3625 'content' => 'Selected (yellow) color.',
3626 'dependency' => array( 'opt-depend-checkbox-1', 'contains', 'yellow' ),
3627 ),
3628
3629 array(
3630 'type' => 'notice',
3631 'style' => 'success',
3632 'content' => 'Selected (green) color.',
3633 'dependency' => array( 'opt-depend-checkbox-1', 'contains', 'green' ),
3634 ),
3635
3636 )
3637 ) );
3638
3639 //
3640 // Validate
3641 //
3642 CSF::createSection( $prefix, array(
3643 'title' => 'Validate',
3644 'icon' => 'fas fa-check-circle',
3645 'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/faq?id=how-to-use-validate" target="_blank">How to use validate</a>',
3646 'fields' => array(
3647
3648 array(
3649 'id' => 'opt-validate-1',
3650 'type' => 'text',
3651 'title' => 'Email validate',
3652 'subtitle' => 'This text field only allows validated email address.',
3653 'default' => 'info@domain.com',
3654 'validate' => 'csf_validate_email',
3655 ),
3656
3657 array(
3658 'id' => 'opt-validate-2',
3659 'type' => 'text',
3660 'title' => 'Numeric validate',
3661 'subtitle' => 'This text field only allows numbers',
3662 'default' => '123456',
3663 'validate' => 'csf_validate_numeric',
3664 ),
3665
3666 array(
3667 'id' => 'opt-validate-3',
3668 'type' => 'text',
3669 'title' => 'Required validate',
3670 'subtitle' => 'This text field is required, cannot be pass empty.',
3671 'default' => 'Lorem ipsum value',
3672 'validate' => 'csf_validate_required',
3673 ),
3674
3675 array(
3676 'id' => 'opt-validate-4',
3677 'type' => 'text',
3678 'title' => 'URL validate',
3679 'subtitle' => 'This text field only allows validated url address.',
3680 'default' => 'http://codestarframework.com',
3681 'validate' => 'csf_validate_url',
3682 ),
3683
3684 )
3685 ) );
3686
3687 //
3688 // Sanitize
3689 //
3690 CSF::createSection( $prefix, array(
3691 'title' => 'Sanitize',
3692 'icon' => 'fas fa-redo',
3693 'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/faq?id=how-to-use-sanitize" target="_blank">How to use sanitize</a>',
3694 'fields' => array(
3695
3696 array(
3697 'id' => 'opt-sanitize-1',
3698 'type' => 'text',
3699 'title' => 'Sanitize (a) to (b)',
3700 'subtitle' => 'Replacing letter (a) to letter (b). for eg. apple to bpple',
3701 'sanitize' => 'csf_sanitize_replace_a_to_b'
3702 ),
3703
3704 array(
3705 'id' => 'opt-sanitize-2',
3706 'type' => 'text',
3707 'title' => 'Sanitize Title',
3708 'subtitle' => 'Converting (space) to (-) and (uppercase) letters to (lowercase) letters. for eg. Hello World to hello-world',
3709 'sanitize' => 'csf_sanitize_title'
3710 ),
3711
3712 )
3713 ) );
3714
3715 //
3716 // Field: backup
3717 //
3718 CSF::createSection( $prefix, array(
3719 'title' => 'Backup',
3720 'icon' => 'fas fa-shield-alt',
3721 'description' => 'Visit documentation for more details on this field: <a href="http://codestarframework.com/documentation/#/fields?id=backup" target="_blank">Field: backup</a>',
3722 'fields' => array(
3723
3724 array(
3725 'type' => 'backup',
3726 ),
3727
3728 )
3729 ) );
3730
3731 //
3732 // Others
3733 //
3734 CSF::createSection( $prefix, array(
3735 'title' => 'Others',
3736 'icon' => 'fas fa-bolt',
3737 'description' => 'Visit documentation for more details: <a href="http://codestarframework.com/documentation/#/fields?id=others" target="_blank">Others</a>',
3738 'fields' => array(
3739
3740 array(
3741 'type' => 'heading',
3742 'content' => 'This is a heading field',
3743 ),
3744
3745 array(
3746 'type' => 'subheading',
3747 'content' => 'This is a subheading field',
3748 ),
3749
3750 array(
3751 'type' => 'content',
3752 'content' => 'This is a content field',
3753 ),
3754
3755 array(
3756 'type' => 'submessage',
3757 'style' => 'success',
3758 'content' => 'This is a <strong>submessage</strong> field. And using style <strong>success</strong>',
3759 ),
3760
3761 array(
3762 'type' => 'content',
3763 'content' => 'This is a content field',
3764 ),
3765
3766 array(
3767 'type' => 'submessage',
3768 'style' => 'info',
3769 'content' => 'This is a <strong>submessage</strong> field. And using style <strong>info</strong>',
3770 ),
3771
3772 array(
3773 'type' => 'submessage',
3774 'style' => 'warning',
3775 'content' => 'This is a <strong>submessage</strong> field. And using style <strong>warning</strong>',
3776 ),
3777
3778 array(
3779 'type' => 'submessage',
3780 'style' => 'danger',
3781 'content' => 'This is a <strong>submessage</strong> field. And using style <strong>danger</strong>',
3782 ),
3783
3784 array(
3785 'type' => 'notice',
3786 'style' => 'success',
3787 'content' => 'This is a <strong>notice</strong> field. And using style <strong>success</strong>',
3788 ),
3789
3790 array(
3791 'type' => 'notice',
3792 'style' => 'info',
3793 'content' => 'This is a <strong>notice</strong> field. And using style <strong>info</strong>',
3794 ),
3795
3796 array(
3797 'type' => 'notice',
3798 'style' => 'warning',
3799 'content' => 'This is a <strong>notice</strong> field. And using style <strong>warning</strong>',
3800 ),
3801
3802 array(
3803 'type' => 'notice',
3804 'style' => 'danger',
3805 'content' => 'This is a <strong>notice</strong> field. And using style <strong>danger</strong>',
3806 ),
3807
3808 array(
3809 'type' => 'content',
3810 'content' => 'This is a <strong>content</strong> field. You can write some contents here.',
3811 ),
3812
3813 )
3814 ) );
3815