WordPress custom post type generator is a tool that allows you to more easily and effectively manage customized content on your WordPress site.
// Register custom post type
// Post type: My Custom Post
function create_mycustompost_post_type() {
$labels = array(
'name' => _x('My Custom Posts', 'Post Type General Name', 'text-domain'),
'singular_name' => _x('My Custom Post', 'Post Type Singular Name', 'text-domain'),
'menu_name' => _x('My Custom Posts', 'Admin Menu text', 'text-domain'),
'name_admin_bar' => _x('My Custom Post', 'Add New on Toolbar', 'text-domain'),
'archives' => __('My Custom Post', 'text-domain'),
'attributes' => __('My Custom Post', 'text-domain'),
'parent_item_colon' => __('My Custom Post', 'text-domain'),
'all_items' => __('All My Custom Posts', 'text-domain'),
'add_new_item' => __('Add New My Custom Post', 'text-domain'),
'add_new' => __('Add New', 'text-domain'),
'new_item' => __('New My Custom Post', 'text-domain'),
'edit_item' => __('Edit My Custom Post', 'text-domain'),
'update_item' => __('Update My Custom Post', 'text-domain'),
'view_item' => __('View My Custom Post', 'text-domain'),
'view_items' => __('View My Custom Posts', 'text-domain'),
'search_items' => __('Search My Custom Post', 'text-domain'),
'not_found' => __('Not found', 'text-domain'),
'not_found_in_trash' => __('Not found in Trash', 'text-domain'),
'featured_image' => __('Featured Image', 'text-domain'),
'set_featured_image' => __('Set featured image', 'text-domain'),
'remove_featured_image' => __('Remove featured image', 'text-domain'),
'use_featured_image' => __('Use as featured image', 'text-domain'),
'insert_into_item' => __('Insert into My Custom Post', 'text-domain'),
'uploaded_to_this_item' => __('Uploaded to this My Custom Post', 'text-domain'),
'items_list' => __('My Custom Posts list', 'text-domain'),
'items_list_navigation' => __('My Custom Posts list navigation', 'text-domain'),
'filter_items_list' => __('Filter My Custom Posts list', 'text-domain'),
);
$args = array(
'label' => __('My Custom Post', 'text-domain'),
'description' => __('Lorem ipsum dolor sit amet.', 'text-domain'),
'labels' => $labels,
'menu_icon' => 'dashicons-admin-appearance',
'supports' => array(),
'taxonomies' => array(),
'hierarchical' => false,
'exclude_from_search' => false,
'publicly_queryable' => false,
'has_archive' => false,
'public' => false,
'show_ui' => false,
'show_in_menu' => false,
'show_in_admin_bar' => false,
'can_export' => false,
'show_in_nav_menus' => false,
'menu_position' => 5,
'capability_type' => 'post',
'show_in_rest' => false,
'rest_base' => '',
'rest_controller_class' => '',
'rewrite' => true,
'query_var' => '',
);
register_post_type('custom-post', $args);
}
add_action('init', 'create_mycustompost_post_type', 0);