-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
1810 lines (1752 loc) · 92.8 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Append the Version -- Custom Post
*/
add_filter(/**
* @param $version
*
* @return array
*/
'fed_plugin_versions', function ($version) {
return array_merge($version, array('custom_post' => 'Custom Post ('.FED_CP_PLUGIN_VERSION.')'));
});
/**
* @param array $request
*
* @return array
*/
function fed_cp_get_custom_post_types(array $request = array())
{
$labels = array(
'Basic Settings' => array(
'slug' => array(
'name' => __('Post Type Slug', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) movies or mov_ies', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['slug']) ? $request['slug'] : '',
'input_meta' => 'slug',
'class_name' => 'fed_convert_space_to_underscore',
'is_required' => 'true',
),
'required' => true,
'help_message' => fed_show_help_message(array(
'content' => 'Post type slug',
)),
),
'label' => array(
'name' => __('Plural Name', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Movies', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['label']) ? $request['label'] : '',
'input_meta' => 'label',
'is_required' => 'true',
),
'required' => true,
'help_message' => fed_show_help_message(array('content' => ' A plural descriptive name for the post type marked for translation.')),
),
'singular_name' => array(
'name' => __('Singular Name', 'frontend-dashboard-custom-post'),
'input' => array(
'required' => 'true',
'placeholder' => __('(eg) Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['singular_name']) ? $request['singular_name'] : '',
'input_meta' => 'singular_name',
),
'required' => true,
'help_message' => fed_show_help_message(array('content' => 'General name for the post type, usually singular.')),
),
'menu_icon' => array(
'name' => __('Menu Icon', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('Click to get Menu Icons', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['menu_icon']) ? $request['menu_icon'] : '',
'input_meta' => 'menu_icon',
'class_name' => 'fed_cp_menu_icon menu_icon',
'extra' => 'data-fed_menu_box_id="menu_icon" data-toggle="modal" data-target=".fed_show_fa_list"',
),
'help_message' => fed_show_help_message(array('content' => 'Custom post type menu icon')),
),
),
'Label Settings' => array(
'name' => array(
'name' => __('Name', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Horror Movies', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['name']) ? $request['name'] : '',
'input_meta' => 'name',
),
'help_message' => fed_show_help_message(array('content' => 'General name for the post type, usually plural.')),
),
'menu_name' => array(
'name' => __('Menu Name', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Horror Movies', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['menu_name']) ? $request['menu_name'] : '',
'input_meta' => 'menu_name',
),
'help_message' => fed_show_help_message(array('content' => 'Default is the same as `name`')),
),
'name_admin_bar' => array(
'name' => __('Name Admin Bar', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Horror Movies', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['name_admin_bar']) ? $request['name_admin_bar'] : '',
'input_meta' => 'name_admin_bar',
),
'help_message' => fed_show_help_message(array('content' => 'String for use in New in Admin menu bar. Default is the same as `singular_name`.')),
),
'archives' => array(
'name' => __('(eg) Movies Archives', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('Item Archives', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['archives']) ? $request['archives'] : '',
'input_meta' => 'archives',
),
'help_message' => fed_show_help_message(array('content' => 'String for use with archives in nav menus. Default is Post Archives/Page Archives.')),
),
'attributes' => array(
'name' => __('Attributes', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Movies Attributes', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['attributes']) ? $request['attributes'] : '',
'input_meta' => 'attributes',
),
'help_message' => fed_show_help_message(array('content' => 'Label for the attributes meta box. Default is Post Attributes / Page Attributes ')),
),
'parent_item_colon' => array(
'name' => __('Parent Item Colon', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Movies:', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['parent_item_colon']) ? $request['parent_item_colon'] : '',
'input_meta' => 'parent_item_colon',
),
'help_message' => fed_show_help_message(array('content' => 'This string isn\'t used on non-hierarchical types. In hierarchical ones the default is Parent Page:')),
),
'all_items' => array(
'name' => __('All Items', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) All Movies', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['all_items']) ? $request['all_items'] : '',
'input_meta' => 'all_items',
),
'help_message' => fed_show_help_message(array('content' => 'String for the submenu. Default is All Posts/All Pages.')),
),
'add_new_item' => array(
'name' => __('Add New Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Add New Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['add_new_item']) ? $request['add_new_item'] : '',
'input_meta' => 'add_new_item',
),
'help_message' => fed_show_help_message(array('content' => __('Default is Add New Post/Add New Page.', 'frontend-dashboard-custom-post'))),
),
'add_new' => array(
'name' => __('Add New', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Add New', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['add_new']) ? $request['add_new'] : '',
'input_meta' => 'add_new',
),
'help_message' => fed_show_help_message(array('content' => 'Default is Edit Post/Edit Page.')),
),
'new_item' => array(
'name' => __('New Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) New Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['new_item']) ? $request['new_item'] : '',
'input_meta' => 'new_item',
),
'help_message' => fed_show_help_message(array('content' => 'Default is New Post/New Page.')),
),
'edit_item' => array(
'name' => __('Edit Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Edit Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['edit_item']) ? $request['edit_item'] : '',
'input_meta' => 'edit_item',
),
'help_message' => fed_show_help_message(array('content' => 'Default is Edit Post/Edit Page.')),
),
'view_item' => array(
'name' => __('View Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) View Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['view_item']) ? $request['view_item'] : '',
'input_meta' => 'view_item',
),
'help_message' => fed_show_help_message(array('content' => 'Default is View Post/View Page')),
),
'view_items' => array(
'name' => __('View Items', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) View Movies', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['view_items']) ? $request['view_items'] : '',
'input_meta' => 'view_items',
),
'help_message' => fed_show_help_message(array('content' => ' Label for viewing post type archives. Default is View Posts / View Pages .')),
),
'search_items' => array(
'name' => __('Search Items', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Search Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['search_items']) ? $request['search_items'] : '',
'input_meta' => 'search_items',
),
'help_message' => fed_show_help_message(array('content' => 'Default is Search Posts/Search Pages')),
),
'not_found' => array(
'name' => __('Not Found', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Movie Not found', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['not_found']) ? $request['not_found'] : '',
'input_meta' => 'not_found',
),
'help_message' => fed_show_help_message(array('content' => 'Default is No posts found/No pages found.')),
),
'not_found_in_trash' => array(
'name' => __('Not Found in Trash', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Movie Not found in Trash', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['not_found_in_trash']) ? $request['not_found_in_trash'] : '',
'input_meta' => 'not_found_in_trash',
),
'help_message' => fed_show_help_message(array('content' => 'Default is No posts found in Trash/No pages found in Trash.')),
),
'featured_image' => array(
'name' => __('Featured Image', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Featured Image for this Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['featured_image']) ? $request['featured_image'] : '',
'input_meta' => 'featured_image',
),
'help_message' => fed_show_help_message(array('content' => 'Default is Featured Image.')),
),
'set_featured_image' => array(
'name' => __('Set Featured Image', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Set featured image for this Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['set_featured_image']) ? $request['set_featured_image'] : '',
'input_meta' => 'set_featured_image',
),
'help_message' => fed_show_help_message(array('content' => 'Default is Set featured image.')),
),
'remove_featured_image' => array(
'name' => __('Remove Featured Image', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Remove featured image for this Movie',
'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['remove_featured_image']) ? $request['remove_featured_image'] : '',
'input_meta' => 'remove_featured_image',
),
'help_message' => fed_show_help_message(array('content' => 'Default is Remove featured image.')),
),
'use_featured_image' => array(
'name' => __('Use Featured Image', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Use as featured image for this Movie',
'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['use_featured_image']) ? $request['use_featured_image'] : '',
'input_meta' => 'use_featured_image',
),
'help_message' => fed_show_help_message(array('content' => 'Default is Use as featured image.')),
),
'insert_into_item' => array(
'name' => __('Insert into Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Insert into Movie', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['insert_into_item']) ? $request['insert_into_item'] : '',
'input_meta' => 'insert_into_item',
),
'help_message' => fed_show_help_message(array('content' => 'String for the media frame button. Default is Insert into post/Insert into page.')),
),
'uploaded_to_this_item' => array(
'name' => __('Uploaded to this Movie', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Uploaded to this item', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['uploaded_to_this_item']) ? $request['uploaded_to_this_item'] : '',
'input_meta' => 'uploaded_to_this_item',
),
'help_message' => fed_show_help_message(array('content' => 'String for the media frame filter. Default is Uploaded to this post/Uploaded to this page.')),
),
'items_list' => array(
'name' => __('Items List', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Movies list', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['items_list']) ? $request['items_list'] : '',
'input_meta' => 'items_list',
),
'help_message' => fed_show_help_message(array('content' => 'String for the table hidden heading.')),
),
'items_list_navigation' => array(
'name' => __('Items List Navigation', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Movies list navigation', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['items_list_navigation']) ? $request['items_list_navigation'] : '',
'input_meta' => 'items_list_navigation',
),
'help_message' => fed_show_help_message(array('content' => 'String for the table pagination hidden heading.')),
),
'filter_items_list' => array(
'name' => __('Filter items list', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Filter Movies list', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['filter_items_list']) ? $request['filter_items_list'] : '',
'input_meta' => 'filter_items_list',
),
'help_message' => fed_show_help_message(array('content' => 'String for the table views hidden heading.')),
),
'description' => array(
'name' => __('Description', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Description', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['description']) ? $request['description'] : '',
'input_meta' => 'description',
),
'help_message' => fed_show_help_message(array('content' => 'A short descriptive summary of what the post type is.')),
),
'menu_position' => array(
'name' => __('Menu Position', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg)20 or 30 or any integer value', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['menu_position']) ? $request['menu_position'] : '',
'input_meta' => 'menu_position',
),
'help_message' => fed_show_help_message(array('content' => 'The position in the menu order the post type should appear')),
),
'capability_type' => array(
'name' => __('Capability Type', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg)Default is post', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['capability_type']) ? $request['capability_type'] : 'post',
'input_meta' => 'capability_type',
),
'help_message' => fed_show_help_message(array('content' => 'The string to use to build the read, edit, and delete capabilities')),
),
),
'Settings' => array(
'hierarchical' => array(
'name' => __('Hierarchical', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['hierarchical']) ? $request['hierarchical'] : '',
'input_meta' => 'hierarchical',
'input_value' => array('false' => 'False', 'true' => 'True'),
),
'help_message' => fed_show_help_message(array('content' => 'Whether the post type is hierarchical (e.g. page). Allows Parent to be specified. The supports parameter should contain page-attributes to show the parent select box on the editor page..')),
),
'public' => array(
'name' => __('Public', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['public']) ? $request['public'] : '',
'input_meta' => 'public',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Controls how the type is visible to authors (show_in_nav_menus, show_ui) and readers (exclude_from_search, publicly_queryable).')),
),
'show_ui' => array(
'name' => __('Show UI', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_ui']) ? $request['show_ui'] : '',
'input_meta' => 'show_ui',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Whether to generate a default UI for managing this post type in the admin.')),
),
'show_in_menu' => array(
'name' => __('Show in Menu', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_menu']) ? $request['show_in_menu'] : '',
'input_meta' => 'show_in_menu',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Where to show the post type in the admin menu')),
),
'show_in_admin_bar' => array(
'name' => __('Show in Admin Bar', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_admin_bar']) ? $request['show_in_admin_bar'] : '',
'input_meta' => 'show_in_admin_bar',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Whether to make this post type available in the WordPress admin bar')),
),
'show_in_nav_menus' => array(
'name' => __('Show in Nav Menus', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_nav_menus']) ? $request['show_in_nav_menus'] : '',
'input_meta' => 'show_in_nav_menus',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Whether post_type is available for selection in navigation menus')),
),
'can_export' => array(
'name' => __('Can Export', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['can_export']) ? $request['can_export'] : '',
'input_meta' => 'can_export',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Can this post_type be exported.')),
),
'has_archive' => array(
'name' => __('Has Archive', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['has_archive']) ? $request['has_archive'] : '',
'input_meta' => 'has_archive',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Enables post type archives. Will use $post_type as archive slug by default.')),
),
'exclude_from_search' => array(
'name' => __('Exclude from Search', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['exclude_from_search']) ? $request['exclude_from_search'] : '',
'input_meta' => 'exclude_from_search',
'input_value' => array('false' => 'False', 'true' => 'True'),
),
'help_message' => fed_show_help_message(array('content' => 'Enables post type archives. Will use $post_type as archive slug by default.')),
),
'publicly_queryable' => array(
'name' => __('Publicly Queryable', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['publicly_queryable']) ? $request['publicly_queryable'] : '',
'input_meta' => 'publicly_queryable',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Whether queries can be performed on the front end as part of parse_request()')),
),
'query_var' => array(
'name' => __('Query Var', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['query_var']) ? $request['query_var'] : '',
'input_meta' => 'query_var',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Sets the query_var key for this post type.')),
),
'delete_with_user' => array(
'name' => __('Delete with user', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['delete_with_user']) ? $request['delete_with_user'] : '',
'input_meta' => 'delete_with_user',
'input_value' => array('false' => 'False', 'true' => 'True'),
),
'help_message' => fed_show_help_message(array('content' => 'Whether to delete posts of this type when deleting a user. If true, posts of this type belonging to the user will be moved to trash when then user is deleted. If false, posts of this type belonging to the user will not be trashed or deleted')),
),
'show_in_rest' => array(
'name' => __('Show in REST', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_rest']) ? $request['show_in_rest'] : '',
'input_meta' => 'show_in_rest',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Whether to expose this post type in the REST API.')),
),
'rest_base' => array(
'name' => __('REST base', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) REST base', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['rest_base']) ? $request['rest_base'] : '',
'input_meta' => 'rest_base',
),
'help_message' => fed_show_help_message(array('content' => 'The base slug that this post type will use when accessed using the REST API.')),
),
'rewrite' => array(
'name' => __('Rewrite URL', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['rewrite']) ? $request['rewrite'] : '',
'input_meta' => 'rewrite',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => 'Triggers the handling of rewrites for this post type. To prevent rewrites, set to false.')),
),
'rewrite_slug' => array(
'name' => __('Rewrite URL Slug', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Rewrite URL Slug', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['rewrite_slug']) ? $request['rewrite_slug'] : '',
'input_meta' => 'rewrite_slug',
),
'help_message' => fed_show_help_message(array('content' => 'Slug to rewrite the default url base')),
),
),
'Taxonomies' => fed_cp_checkbox_taxonomies($request),
'Supports' => array(
'title' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['title']) ? $request['supports']['title'] : 'Enabled',
'input_meta' => 'supports[title]',
'label' => __('Title', 'frontend-dashboard-custom-post'),
'default_value' => 'Enabled',
),
),
'editor' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['editor']) ? $request['supports']['editor'] : 'Enable',
'input_meta' => 'supports[editor]',
'label' => __('Editor', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'author' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['author']) ? $request['supports']['author'] : '',
'input_meta' => 'supports[author]',
'label' => __('Author', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'thumbnail' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['thumbnail']) ? $request['supports']['thumbnail'] : '',
'input_meta' => 'supports[thumbnail]',
'label' => __('Thumbnail', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'excerpt' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['excerpt']) ? $request['supports']['excerpt'] : '',
'input_meta' => 'supports[excerpt]',
'label' => __('Excerpt', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'trackbacks' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['trackbacks']) ? $request['supports']['trackbacks'] : '',
'input_meta' => 'supports[trackbacks]',
'label' => __('Trackbacks', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'custom-fields' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['custom-fields']) ? $request['supports']['custom-fields'] : '',
'input_meta' => 'supports[custom-fields]',
'label' => __('Custom Fields', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'comments' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['comments']) ? $request['supports']['comments'] : '',
'input_meta' => 'supports[comments]',
'label' => __('Comments', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'revisions' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['revisions']) ? $request['supports']['revisions'] : '',
'input_meta' => 'supports[revisions]',
'label' => __('Revisions', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'page-attributes' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['page-attributes']) ? $request['supports']['page-attributes'] : '',
'input_meta' => 'supports[page-attributes]',
'label' => __('Page Attributes', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
'post-formats' => array(
'name' => null,
'input' => array(
'input_type' => 'checkbox',
'user_value' => isset($request['supports']['post-formats']) ? $request['supports']['post-formats'] : '',
'input_meta' => 'supports[post-formats]',
'label' => __('Post Formats', 'frontend-dashboard-custom-post'),
'default_value' => 'Enable',
),
),
),
);
return $labels;
}
/**
* @param array $request
*
* @return array
*/
function fed_cp_get_taxonomies_label(array $request = array())
{
$labels = array(
'Basic Settings' => array(
'slug' => array(
'name' => __('Taxonomy Slug', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) actors (or) act_ors', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['slug']) ? $request['slug'] : '',
'input_meta' => 'slug',
'class_name' => 'fed_convert_space_to_underscore',
'is_required' => 'true',
),
'required' => true,
'help_message' => fed_show_help_message(array(
'content' => __('Taxonomy slug, No Capital letter, space and special characters','frontend-dashboard-custom-post')
)),
),
'label' => array(
'name' => __('Plural Name', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Actors', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['label']) ? $request['label'] : '',
'input_meta' => 'label',
'is_required' => 'true',
),
'required' => true,
'help_message' => fed_show_help_message(array('content' => __(' A plural descriptive name for the taxonomy marked for translation.','frontend-dashboard-custom-post'))),
),
'singular_name' => array(
'name' => __('Singular Name', 'frontend-dashboard-custom-post'),
'input' => array(
'required' => 'true',
'placeholder' => __('(eg) Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['singular_name']) ? $request['singular_name'] : '',
'input_meta' => 'singular_name',
),
'required' => true,
'help_message' => fed_show_help_message(array('content' => __('General name for the taxonomy, usually singular.','frontend-dashboard-custom-post'))),
),
'fed_extra' => array(
'input' => fed_cp_checkbox_post_type($request),
'label' => 'Attach to Post Type',
'required' => true,
'help_message' => fed_show_help_message(array(
'content' => __('Select any one post type','frontend-dashboard-custom-post')
)),
),
),
'Label Settings' => array(
'name' => array(
'name' => __('Name', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Actors', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['name']) ? $request['name'] : '',
'input_meta' => 'name',
),
'help_message' => fed_show_help_message(array('content' => __('General name for the taxonomy, usually plural.','frontend-dashboard-custom-post'))),
),
'menu_name' => array(
'name' => __('Menu Name', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Actors', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['menu_name']) ? $request['menu_name'] : '',
'input_meta' => 'menu_name',
),
'help_message' => fed_show_help_message(array('content' => __('Default is the same as `name`','frontend-dashboard-custom-post'))),
),
'parent_item_colon' => array(
'name' => __('Parent Item Colon', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Actors:', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['parent_item_colon']) ? $request['parent_item_colon'] : '',
'input_meta' => 'parent_item_colon',
),
'help_message' => fed_show_help_message(array('content' => __('This string isn\'t used on non-hierarchical types. In hierarchical ones the default is Parent Page:','frontend-dashboard-custom-post'))),
),
'all_items' => array(
'name' => __('All Items', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) All Actors', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['all_items']) ? $request['all_items'] : '',
'input_meta' => 'all_items',
),
'help_message' => fed_show_help_message(array('content' => __('String for the submenu. Default is All Posts/All Pages.','frontend-dashboard-custom-post'))),
),
'add_new_item' => array(
'name' => __('Add New Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Add New Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['add_new_item']) ? $request['add_new_item'] : '',
'input_meta' => 'add_new_item',
),
'help_message' => fed_show_help_message(array('content' => __('Default is Add New Post/Add New Page.','frontend-dashboard-custom-post'))),
),
'new_item_name' => array(
'name' => __('New Item Name', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) New Actor Name', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['new_item_name']) ? $request['new_item_name'] : '',
'input_meta' => 'new_item_name',
),
'help_message' => fed_show_help_message(array('content' => __('Default is New Item Name','frontend-dashboard-custom-post'))),
),
'edit_item' => array(
'name' => __('Edit Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Edit Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['edit_item']) ? $request['edit_item'] : '',
'input_meta' => 'edit_item',
),
'help_message' => fed_show_help_message(array('content' => __('Default is Edit Post/Edit Page.','frontend-dashboard-custom-post'))),
),
'view_item' => array(
'name' => __('View Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) View Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['view_item']) ? $request['view_item'] : '',
'input_meta' => 'view_item',
),
'help_message' => fed_show_help_message(array('content' => __('Default is View Post/View Page','frontend-dashboard-custom-post'))),
),
'update_item' => array(
'name' => __('Update Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Update Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['update_item']) ? $request['update_item'] : '',
'input_meta' => 'update_item',
),
'help_message' => fed_show_help_message(array('content' => __('Default is Update Item','frontend-dashboard-custom-post'))),
),
'parent_item' => array(
'name' => __('Parent Item', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Parent Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['parent_item']) ? $request['parent_item'] : '',
'input_meta' => 'parent_item',
),
'help_message' => fed_show_help_message(array('content' => __('Default is Update Item','frontend-dashboard-custom-post'))),
),
'search_items' => array(
'name' => __('Search Items', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Search Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['search_items']) ? $request['search_items'] : '',
'input_meta' => 'search_items',
),
'help_message' => fed_show_help_message(array('content' => __('Default is Search Posts/Search Pages','frontend-dashboard-custom-post'))),
),
'not_found' => array(
'name' => __('Not Found', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Actor Not found', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['not_found']) ? $request['not_found'] : '',
'input_meta' => 'not_found',
),
'help_message' => fed_show_help_message(array('content' => __('Default is No posts found/No pages found.','frontend-dashboard-custom-post'))),
),
'description' => array(
'name' => __('Description', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Description', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['description']) ? $request['description'] : '',
'input_meta' => 'description',
),
'help_message' => fed_show_help_message(array('content' => __('A short descriptive summary of what the taxonomy is.','frontend-dashboard-custom-post'))),
),
'popular_items' => array(
'name' => __('Popular Items', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Popular Actor(s)', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['popular_items']) ? $request['popular_items'] : '',
'input_meta' => 'popular_items',
),
'help_message' => fed_show_help_message(array('content' => __('The popular items text. This string is not used on hierarchical taxonomies. Default is Popular Tags or null','frontend-dashboard-custom-post'))),
),
'separate_items_with_commas' => array(
'name' => __('Separate Item with commas', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Separate Actors with commas', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['separate_items_with_commas']) ? $request['separate_items_with_commas'] : '',
'input_meta' => 'separate_items_with_commas',
),
'help_message' => fed_show_help_message(array('content' => __('The separate item with commas text used in the taxonomy meta box. This string is not used on hierarchical taxonomies. Default is __( \'Separate tags with commas\' ), or null','frontend-dashboard-custom-post'))),
),
'add_or_remove_items' => array(
'name' => __('Add or remove tags', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Add or remove Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['add_or_remove_items']) ? $request['add_or_remove_items'] : '',
'input_meta' => 'add_or_remove_items',
),
'help_message' => fed_show_help_message(array('content' => __('the add or remove items text and used in the meta box when JavaScript is disabled. This string is not used on hierarchical taxonomies. Default is __( \'Add or remove tags\' ) or null','frontend-dashboard-custom-post'))),
),
'choose_from_most_used' => array(
'name' => __('Choose from the most used tags', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) Choose from the most used Actor', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['choose_from_most_used']) ? $request['choose_from_most_used'] : '',
'input_meta' => 'choose_from_most_used',
),
'help_message' => fed_show_help_message(array('content' => __('the choose from most used text used in the taxonomy meta box. This string is not used on hierarchical taxonomies. Default is __( \'Choose from the most used tags\' ) or null','frontend-dashboard-custom-post'))),
),
),
'Settings' => array(
'hierarchical' => array(
'name' => __('Hierarchical', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['hierarchical']) ? $request['hierarchical'] : '',
'input_meta' => 'hierarchical',
'input_value' => array('false' => 'False', 'true' => 'True'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether the taxonomy is hierarchical (e.g. page). Allows Parent to be specified. The supports parameter should contain page-attributes to show the parent select box on the editor page..','frontend-dashboard-custom-post'))),
),
'show_tagcloud' => array(
'name' => __('Show Tag Cloud', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_tagcloud']) ? $request['show_tagcloud'] : '',
'input_meta' => 'show_tagcloud',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether to allow the Tag Cloud widget to use this taxonomy.','frontend-dashboard-custom-post'))),
),
'show_in_quick_edit' => array(
'name' => __('Show in Quick Edit', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_quick_edit']) ? $request['show_in_quick_edit'] : '',
'input_meta' => 'show_in_quick_edit',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether to show the taxonomy in the quick/bulk edit panel','frontend-dashboard-custom-post'))),
),
'show_admin_column' => array(
'name' => __('Show admin column', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_admin_column']) ? $request['show_admin_column'] : '',
'input_meta' => 'show_admin_column',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether to allow automatic creation of taxonomy columns on associated post-types table','frontend-dashboard-custom-post'))),
),
'sort' => array(
'name' => __('Sort', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['sort']) ? $request['sort'] : '',
'input_meta' => 'sort',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether this taxonomy should remember the order in which terms are added to objects','frontend-dashboard-custom-post'))),
),
'public' => array(
'name' => __('Public', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['public']) ? $request['public'] : '',
'input_meta' => 'public',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Controls how the type is visible to authors (show_in_nav_menus, show_ui) and readers (exclude_from_search, publicly_queryable).','frontend-dashboard-custom-post'))),
),
'show_ui' => array(
'name' => __('Show UI', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_ui']) ? $request['show_ui'] : '',
'input_meta' => 'show_ui',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether to generate a default UI for managing this taxonomy in the admin.','frontend-dashboard-custom-post'))),
),
'show_in_menu' => array(
'name' => __('Show in Menu', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_menu']) ? $request['show_in_menu'] : '',
'input_meta' => 'show_in_menu',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Where to show the taxonomy in the admin menu','frontend-dashboard-custom-post'))),
),
'show_in_nav_menus' => array(
'name' => __('Show in Nav Menus', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_nav_menus']) ? $request['show_in_nav_menus'] : '',
'input_meta' => 'show_in_nav_menus',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether post_type is available for selection in navigation menus','frontend-dashboard-custom-post'))),
),
'publicly_queryable' => array(
'name' => __('Publicly Queryable', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['publicly_queryable']) ? $request['publicly_queryable'] : '',
'input_meta' => 'publicly_queryable',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether queries can be performed on the front end as part of parse_request()','frontend-dashboard-custom-post'))),
),
'query_var' => array(
'name' => __('Query Var', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['query_var']) ? $request['query_var'] : '',
'input_meta' => 'query_var',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Sets the query_var key for this taxonomy.','frontend-dashboard-custom-post'))),
),
'show_in_rest' => array(
'name' => __('Show in REST', 'frontend-dashboard-custom-post'),
'input' => array(
'input_type' => 'select',
'user_value' => isset($request['show_in_rest']) ? $request['show_in_rest'] : '',
'input_meta' => 'show_in_rest',
'input_value' => array('true' => 'True', 'false' => 'False'),
),
'help_message' => fed_show_help_message(array('content' => __('Whether to expose this taxonomy in the REST API.','frontend-dashboard-custom-post'))),
),
'rest_base' => array(
'name' => __('REST base', 'frontend-dashboard-custom-post'),
'input' => array(
'placeholder' => __('(eg) REST base', 'frontend-dashboard-custom-post'),
'input_type' => 'single_line',
'user_value' => isset($request['rest_base']) ? $request['rest_base'] : '',
'input_meta' => 'rest_base',