-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesd-cpt.php
63 lines (55 loc) · 1.6 KB
/
esd-cpt.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
<?php
/*
Exam Score Display - Custom Post Types
- This is where all the custom post types are to be declared
*/
function esd_register_custom_post_types(){
$singular = 'Skill';
$plural = 'Skills';
$labels = array(
'name' => $plural,
'singular' => $singular,
'add_name' => 'Add New',
'add_new_item' => 'Add New ' . $singular,
'edit' => 'Edit',
'edit_item' => 'Edit ' . $singular ,
'new_item' => 'New ' . $singular,
'view' => 'View ' . $singular,
'view_item' => 'View ' . $singular,
'search_term' => 'Serach ' . $plural,
'parent' => 'Parent ' . $singular,
'not_found' => 'No ' . $plural . ' found',
'not_found_in_trash' => 'No ' . $plural . ' found'
);
$rewrite_options = array(
'slug' => 'skills',
'with_front' => true,
'pages' => true,
'feeds' => false
);
$supports_options = array('title');
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'show_in_nav_menus' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_admin_bar' => true,
'menu_position' => 10,
'menu_icon' => 'dashicons-welcome-write-blog',
'can_export' => true,
'delete_with_user' => false,
'hierarchical' => false,
'has_archive' => true,
'query_var' => true,
'capability_type' => 'post',
'map_meta_cap' => true,
// 'capabilities' => array()
'supports' => $supports_options,
'rewrite' => $rewrite_options
);
register_post_type( 'Skill', $args );
}
add_action('init', 'esd_register_custom_post_types');