PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.1.8
StreamCast – bring live radio to your site with a sleek player v2.1.8
2.4.5 2.4.4 trunk 1.0 1.1 2.0.0 2.1.10 2.1.2 2.1.4 2.1.5 2.1.8 2.2.1 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 All 29 releases
streamcast / admin / codestar-framework / samples / admin-options.php

admin-options.php in StreamCast – bring live radio to your site with a sleek player 2.1.8, at admin/codestar-framework/samples/admin-options.php

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