-
Notifications
You must be signed in to change notification settings - Fork 0
/
eracom-post-types.php
111 lines (101 loc) · 3.01 KB
/
eracom-post-types.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
<?php
/* Register Post Types
********************
*/
add_action( 'init', 'eracom_register_post_types' );
function eracom_register_post_types() {
register_post_type(
'eracom_projet', array(
'label' =>'Projets',
'description' => 'Projets ERACOM',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_icon' => 'dashicons-format-image', // src: http://melchoyce.github.io/dashicons/
// dashicons-admin-post
'capability_type' => 'post',
'hierarchical' => false,
'has_archive' => false,
'rewrite' => array('slug' => 'projet'),
'query_var' => true,
'exclude_from_search' => false,
'menu_position' => 6,
'supports' => array(
'title',
// 'editor',
// 'revisions',
// 'thumbnail',
'author',
'publicize',
),
'taxonomies' => array( 'eracom_type_de_projet' ),
'labels' => array (
'name' => 'Projets',
'singular_name' => 'Projet',
'menu_name' => 'Projets',
'add_new' => 'Ajouter',
'add_new_item' => 'Ajouter',
'edit' => 'Modifier',
'edit_item' => 'Modifier',
'new_item' => 'Nouveau Projet',
'view' => 'Afficher',
'view_item' => 'Afficher',
'search_items' => 'Rechercher',
'not_found' => 'Aucun résultat',
'not_found_in_trash' => 'Aucun résultat',
'parent' => 'Élément Parent',
),
)
);
register_taxonomy(
'eracom_type_de_projet',
array( 'eracom_projet' ),
array(
'hierarchical' => true,
'show_ui' => true,
'show_admin_column' => true,
'label' => 'Branches',
'rewrite' => array('slug' => 'branche'),
'singular_label' => 'Branche'
)
);
register_post_type(
'eracom_formation', array(
'label' => 'Formation',
'description' => 'Formations ERACOM',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_icon' => 'dashicons-welcome-learn-more', // src: https://developer.wordpress.org/resource/dashicons/
'capability_type' => 'post',
'hierarchical' => false,
'has_archive' => false,
'rewrite' => array('slug' => 'formation'),
'query_var' => true,
'exclude_from_search' => true,
'menu_position' => 6,
'supports' => array(
'title',
// 'editor',
// 'revisions',
// 'thumbnail',
),
'labels' => array (
'name' => 'Formations',
'singular_name' => 'Formation',
'menu_name' => 'Formations',
'add_new' => 'Ajouter',
'add_new_item' => 'Ajouter',
'edit' => 'Modifier',
'edit_item' => 'Modifier',
'new_item' => 'Nouvelle formation',
'view' => 'Afficher',
'view_item' => 'Afficher',
'search_items' => 'Rechercher',
'not_found' => 'Aucun résultat',
'not_found_in_trash' => 'Aucun résultat',
'parent' => 'Élément Parent',
),
)
);
} // end eracom_register_post_types