-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_types.php
70 lines (63 loc) · 2.05 KB
/
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
<?php
function post_types() {
register_post_type('class', array(
'rewrite' => array('slug' => 'classes'),
'has_archive' => true,
'public' => true,
'labels' => array(
'name' => 'Classes',
'add_new_item' => 'Add New Class',
'edit_item' => 'Edit Class',
'all_items' => 'All Classes',
'singular_name' => 'Class'
),
'menu_icon' => 'dashicons-book'
));
//Student Learning Resources Post Type
register_post_type('studentresource', array(
'rewrite' => array('slug' => 'studentresources'),
'has_archive' => true,
'public' => true,
'labels' => array(
'name' => 'Student Learning Resources',
'add_new_item' => 'Add New Resource',
'edit_item' => 'Edit Resource',
'all_items' => 'All Resources',
'singular_name' => 'Student Learning Resource'
),
'menu_icon' => 'dashicons-portfolio'
));
//Teaching Resources Post Type
register_post_type('teachingresource', array(
'rewrite' => array('slug' => 'teachingresources'),
'has_archive' => true,
'public' => true,
'labels' => array(
'name' => 'Teacher Resources',
'add_new_item' => 'Add New Resource',
'edit_item' => 'Edit Resource',
'all_items' => 'All Resources',
'singular_name' => 'Teaching Resource'
),
'menu_icon' => 'dashicons-edit-large'
));
//Real World Learning Resources Post Type
register_post_type('realworldlearning', array(
'rewrite' => array('slug' => 'realworldlearning'),
'has_archive' => true,
'public' => true,
'labels' => array(
'name' => 'Real World Learning Resources',
'add_new_item' => 'Add New Resource',
'edit_item' => 'Edit Resource',
'all_items' => 'All Resources',
'singular_name' => 'Real World Learning Resource'
),
'menu_icon' => 'dashicons-location-alt'
));
}
add_action('init', 'post_types');
// remove default editor and title from Classes in admin - only custom fields will show
add_action('init', function() {
remove_post_type_support( 'class', 'editor' );
}, 99);