Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Case

// Register Custom Post Type
function case_init() {

	$labels = array(
		'name'                => _x( 'cases', 'Post Type General Name', 'GT' ),
		'singular_name'       => _x( 'case', 'Post Type Singular Name', 'GT' ),
		'menu_name'           => __( 'Case', 'GT' ),
		'parent_item_colon'   => __( 'Parent Case:', 'GT' ),
		'all_items'           => __( 'All Cases', 'GT' ),
		'view_item'           => __( 'View Case', 'GT' ),
		'add_new_item'        => __( 'Add New Case', 'GT' ),
		'add_new'             => __( 'Add New', 'GT' ),
		'edit_item'           => __( 'Edit Case', 'GT' ),
		'update_item'         => __( 'Update Case', 'GT' ),
		'search_items'        => __( 'Search Case', 'GT' ),
		'not_found'           => __( 'Not found', 'GT' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'GT' ),
	);
	$rewrite = array(
		'slug'                => 'case',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$args = array(
		'label'               => __( 'case', 'GT' ),
		'description'         => __( 'Case', 'GT' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', ),
		'taxonomies'          => array( 'post_tag', 'casegroup' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 5,
		'menu_icon'           => '',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'rewrite'             => $rewrite,
		'capability_type'     => 'post',
	);
	register_post_type( 'case', $args );

}

// Hook into the 'init' action
add_action( 'init', 'case_init', 0 );