Skip to content

Commit 64745eb

Browse files
committed
feat: bring example custom post type in line with default posts
1 parent 4108f61 commit 64745eb

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

src/php/inc/custom-post-types/example-custom-post-type.php

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,55 @@
99
* @return void
1010
*/
1111
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',
2222
'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',
2929
'not_found' => 'Not found',
3030
'not_found_in_trash' => 'Not found in Trash',
3131
'featured_image' => 'Featured Image',
3232
'set_featured_image' => 'Set featured image',
3333
'remove_featured_image' => 'Remove featured image',
3434
'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',
4040
);
4141
$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.',
4444
'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' ),
4747
'hierarchical' => false,
4848
'public' => true,
4949
'show_ui' => true,
5050
'show_in_menu' => true,
51+
'menu_icon' => 'dashicons-superhero',
52+
'show_in_rest' => true,
5153
'menu_position' => 5,
5254
'show_in_admin_bar' => true,
5355
'show_in_nav_menus' => true,
5456
'can_export' => true,
5557
'has_archive' => true,
5658
'exclude_from_search' => false,
5759
'publicly_queryable' => true,
58-
'capability_type' => 'page',
60+
'capability_type' => 'post',
5961
);
6062
register_post_type( 'example', $args );
6163
}

0 commit comments

Comments
 (0)