1 | <?php |
---|
2 | |
---|
3 | function add_custom_post_types_taxonomies() { |
---|
4 | // Add CPT: Completed projects |
---|
5 | $labels_completed_projects = array( |
---|
6 | 'name' => 'Gerealiseerd', |
---|
7 | 'singular_name' => 'Project', |
---|
8 | 'menu_name' => 'Gerealiseerd', |
---|
9 | 'name_admin_bar' => 'Gerealiseerd project', |
---|
10 | 'archives' => 'Archieven projecten', |
---|
11 | 'attributes' => 'Kenmerken project', |
---|
12 | 'parent_item_colon' => '', |
---|
13 | 'all_items' => 'Alle projecten', |
---|
14 | 'add_new_item' => 'Nieuw project', |
---|
15 | 'add_new' => 'Nieuw project', |
---|
16 | 'new_item' => 'Nieuw project', |
---|
17 | 'edit_item' => 'Project bewerken', |
---|
18 | 'update_item' => 'Project bijwerken', |
---|
19 | 'view_item' => 'Project bekijken', |
---|
20 | 'view_items' => 'Projecten bekijken', |
---|
21 | 'search_items' => 'Zoeken in projecten', |
---|
22 | 'not_found' => 'Niet gevonden', |
---|
23 | 'not_found_in_trash' => 'Niet gevonden in prullenbak', |
---|
24 | 'featured_image' => '', |
---|
25 | 'set_featured_image' => '', |
---|
26 | 'remove_featured_image' => '', |
---|
27 | 'use_featured_image' => '', |
---|
28 | 'insert_into_item' => 'Invoegen bij project', |
---|
29 | 'uploaded_to_this_item' => 'Geüpload naar dit project', |
---|
30 | 'items_list' => 'Lijst van projecten', |
---|
31 | 'items_list_navigation' => 'Lijstnavigatie projecten', |
---|
32 | 'filter_items_list' => 'Lijst van projecten filteren', |
---|
33 | ); |
---|
34 | |
---|
35 | $args_completed_projects = array( |
---|
36 | 'label' => 'Gerealiseerd', |
---|
37 | 'labels' => $labels_completed_projects, |
---|
38 | 'supports' => array('title', 'excerpt', 'editor', 'thumbnail'), |
---|
39 | 'taxonomies' => array('project-categories'), |
---|
40 | 'hierarchical' => false, |
---|
41 | 'public' => true, |
---|
42 | 'show_ui' => true, |
---|
43 | 'show_in_menu' => true, |
---|
44 | 'menu_position' => 20, |
---|
45 | 'menu_icon' => 'dashicons-portfolio', |
---|
46 | 'show_in_admin_bar' => true, |
---|
47 | 'show_in_nav_menus' => true, |
---|
48 | 'can_export' => true, |
---|
49 | 'has_archive' => true, |
---|
50 | 'exclude_from_search' => false, |
---|
51 | 'publicly_queryable' => true, |
---|
52 | 'capability_type' => 'post', |
---|
53 | 'show_in_rest' => true, |
---|
54 | 'rewrite' => array('slug' => 'gerealiseerd'), |
---|
55 | ); |
---|
56 | |
---|
57 | register_post_type('completed_projects', $args_completed_projects); |
---|
58 | |
---|
59 | // Add custom taxonomy: project categories, attached to CPT Completed projects |
---|
60 | $labels_project_cats = array( |
---|
61 | 'name' => 'Projectcategorieën', |
---|
62 | 'singular_name' => 'Projectcategorie', |
---|
63 | 'menu_name' => 'Projectcategorieën', |
---|
64 | 'all_items' => 'Alle projectcategorieën', |
---|
65 | 'parent_item' => 'Bovenliggende categorie', |
---|
66 | 'parent_item_colon' => 'Bovenliggende categorie:', |
---|
67 | 'new_item_name' => 'Nieuwe projectcategorie', |
---|
68 | 'add_new_item' => 'Nieuwe projectcategorie', |
---|
69 | 'edit_item' => 'Projectcategorie bewerken', |
---|
70 | 'update_item' => 'Projectcategorie bijwerken', |
---|
71 | 'view_item' => 'Projectcategorie bekijken', |
---|
72 | 'separate_items_with_commas' => 'Onderscheid items met een komma', |
---|
73 | 'add_or_remove_items' => 'Categorieën toevoegen of verwijderen', |
---|
74 | 'choose_from_most_used' => 'Kies uit de meestgebruikte', |
---|
75 | 'popular_items' => 'Meestgebruikte categorieën', |
---|
76 | 'search_items' => 'Projectcategorieën doorzoeken', |
---|
77 | 'not_found' => 'Niets gevonden', |
---|
78 | 'no_terms' => 'Geen projectcategorieën', |
---|
79 | 'items_list' => 'Lijst van projectcategorieën', |
---|
80 | 'items_list_navigation' => 'Lijstnavigatie projectcategorieën', |
---|
81 | ); |
---|
82 | |
---|
83 | $args_project_cats = array( |
---|
84 | 'labels' => $labels_project_cats, |
---|
85 | 'hierarchical' => true, |
---|
86 | 'public' => true, |
---|
87 | 'show_ui' => true, |
---|
88 | 'show_admin_column' => true, |
---|
89 | 'show_in_nav_menus' => true, |
---|
90 | 'show_tagcloud' => false, |
---|
91 | ); |
---|
92 | |
---|
93 | register_taxonomy('project-categories', array('completed_projects'), $args_project_cats); |
---|
94 | } |
---|
95 | add_action('init', 'add_custom_post_types_taxonomies', 0); |
---|