Here is my code (register post type and register taxonomy) :
// Register Post Type (Holliday)
$capability = 'publish_posts';
$cpt_args = array(
'menu_icon' => 'dashicons-groups',
'labels' => array(
'name' => __( 'Holliday', 'mon-plugin' ),
'singular_name' => __( 'Holliday', 'mon-plugin' ),
'add_new' => __( 'Add Holliday', 'mon-plugin' ),
'add_new_item' => __( 'Add Holliday', 'mon-plugin' ),
'edit' => __( 'Edit', 'mon-plugin' ),
'edit_item' => __( 'Edit Holliday', 'mon-plugin' ),
'new_item' => __( 'New Holliday', 'mon-plugin' ),
'view' => __( 'View Holliday', 'mon-plugin' ),
'view_item' => __( 'View Holliday', 'mon-plugin' ),
'search_items' => __( 'Search Holliday', 'mon-plugin' ),
'not_found' => __( 'No Holliday found', 'mon-plugin' ),
'not_found_in_trash'=> __( 'No Holliday found in Trash', 'mon-plugin' ),
'parent' => __( 'Parent Holliday', 'mon-plugin' ),
),
'public' => true,
'has_archive' => true,
'rewrite' => array(
'slug' => 'holliday/%my_project_location%',
),
'supports' => array('title', 'custom-fields', 'excerpt', 'editor', 'author', 'thumbnail', 'comments'),
'capabilities' => array(
'publish_posts' => $capability,
'edit_posts' => $capability,
'edit_others_posts' => $capability,
'delete_posts' => $capability,
'delete_others_posts'=> $capability,
'read_private_posts'=> $capability,
'edit_post' => $capability,
'delete_post' => $capability,
'read_post' => $capability
),
);
register_post_type( 'my_project', $cpt_args );
// Register Taxonomy (Location)
$cats_args = array(
'labels' => array(
'name' => _x( 'Project Location', 'mon-plugin' ),
'singular_name' => _x( 'Location', 'mon-plugin' ),
'search_items' => __( 'Search Location', 'mon-plugin' ),
'all_items' => __( 'All Location', 'mon-plugin' ),
'parent_item' => __( 'Parent Location', 'mon-plugin' ),
'parent_item_colon' => __( 'Parent Location:', 'mon-plugin' ),
'edit_item' => __( 'Edit Location', 'mon-plugin' ),
'update_item' => __( 'Update Location', 'mon-plugin' ),
'add_new_item' => __( 'Add New Location', 'mon-plugin' ),
'new_item_name' => __( 'New Location Name', 'mon-plugin' ),
'menu_name' => __( 'Location', 'mon-plugin' ),
),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'has_archive' => true,
'rewrite' => array(
'slug' => 'project''holliday',
'hierarchical' => true
)
);
// Register taxonomy
register_taxonomy( 'project_location''my_project_location', 'project''my_project', $cats_args );