|
9 | 9 | * @return void |
10 | 10 | */ |
11 | 11 | function custom_post_type() { |
12 | | - $labels = array( |
13 | | - 'name' => 'Post Types', |
14 | | - 'singular_name' => 'Post Type', |
15 | | - 'menu_name' => 'Post Types', |
16 | | - 'name_admin_bar' => 'Post Type', |
17 | | - 'archives' => 'Item Archives', |
18 | | - 'attributes' => 'Item Attributes', |
19 | | - 'parent_item_colon' => 'Parent Item:', |
20 | | - 'all_items' => 'All Items', |
21 | | - 'add_new_item' => 'Add New Item', |
| 12 | + $labels = array( |
| 13 | + 'name' => 'Example Custom Posts', |
| 14 | + 'singular_name' => 'Example Custom Post', |
| 15 | + 'menu_name' => 'Example Custom Posts', |
| 16 | + 'name_admin_bar' => 'Example Custom Post', |
| 17 | + 'archives' => 'Example Custom Post Archives', |
| 18 | + 'attributes' => 'Example Custom Post Attributes', |
| 19 | + 'parent_item_colon' => 'Parent Post:', |
| 20 | + 'all_items' => 'All Posts', |
| 21 | + 'add_new_item' => 'Add New Post', |
22 | 22 | 'add_new' => 'Add New', |
23 | | - 'new_item' => 'New Item', |
24 | | - 'edit_item' => 'Edit Item', |
25 | | - 'update_item' => 'Update Item', |
26 | | - 'view_item' => 'View Item', |
27 | | - 'view_items' => 'View Items', |
28 | | - 'search_items' => 'Search Item', |
| 23 | + 'new_item' => 'New Post', |
| 24 | + 'edit_item' => 'Edit Post', |
| 25 | + 'update_item' => 'Update Post', |
| 26 | + 'view_item' => 'View Post', |
| 27 | + 'view_items' => 'View Posts', |
| 28 | + 'search_items' => 'Search Post', |
29 | 29 | 'not_found' => 'Not found', |
30 | 30 | 'not_found_in_trash' => 'Not found in Trash', |
31 | 31 | 'featured_image' => 'Featured Image', |
32 | 32 | 'set_featured_image' => 'Set featured image', |
33 | 33 | 'remove_featured_image' => 'Remove featured image', |
34 | 34 | 'use_featured_image' => 'Use as featured image', |
35 | | - 'insert_into_item' => 'Insert into item', |
36 | | - 'uploaded_to_this_item' => 'Uploaded to this item', |
37 | | - 'items_list' => 'Items list', |
38 | | - 'items_list_navigation' => 'Items list navigation', |
39 | | - 'filter_items_list' => 'Filter items list', |
| 35 | + 'insert_into_item' => 'Insert into post', |
| 36 | + 'uploaded_to_this_item' => 'Uploaded to this post', |
| 37 | + 'items_list' => 'Posts list', |
| 38 | + 'items_list_navigation' => 'Posts list navigation', |
| 39 | + 'filter_items_list' => 'Filter posts list', |
40 | 40 | ); |
41 | 41 | $args = array( |
42 | | - 'label' => 'Post Type', |
43 | | - 'description' => 'An Example Custom Post Type', |
| 42 | + 'label' => 'Example Custom Posts', |
| 43 | + 'description' => 'An example custom post type.', |
44 | 44 | 'labels' => $labels, |
45 | | - 'supports' => array( 'title', 'editor' ), |
46 | | - 'taxonomies' => array( 'example_custom_tax' ), |
| 45 | + 'supports' => array( 'title', 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', 'thumbnail' ), |
| 46 | + 'taxonomies' => array( 'category', 'post_tag', 'example_custom_tax' ), |
47 | 47 | 'hierarchical' => false, |
48 | 48 | 'public' => true, |
49 | 49 | 'show_ui' => true, |
50 | 50 | 'show_in_menu' => true, |
| 51 | + 'menu_icon' => 'dashicons-superhero', |
| 52 | + 'show_in_rest' => true, |
51 | 53 | 'menu_position' => 5, |
52 | 54 | 'show_in_admin_bar' => true, |
53 | 55 | 'show_in_nav_menus' => true, |
54 | 56 | 'can_export' => true, |
55 | 57 | 'has_archive' => true, |
56 | 58 | 'exclude_from_search' => false, |
57 | 59 | 'publicly_queryable' => true, |
58 | | - 'capability_type' => 'page', |
| 60 | + 'capability_type' => 'post', |
59 | 61 | ); |
60 | 62 | register_post_type( 'example', $args ); |
61 | 63 | } |
|
0 commit comments