I have registered 2 post types:
register_post_type( 'post_type1' , $args1 ); register_post_type( 'post_type2' , $args2 );
And I've registered a custom taxonomy associated with the second post type:
register_taxonomy('post-type2-category', 'post_type2', array('hierarchical' => true, 'show_in_menu' => true, 'label' => esc_html__('My taxonomy', 'my_lang_slug'), 'singular_label' => esc_html__('My taxonomy', 'my_lang_slug'), 'rewrite' => true, 'slug' => 'post-type2-cat', 'show_in_nav_menus' => false));
I've also put in the
$args2 variable, for second custom post type
'show_in_menu' => 'edit.php?post_type=post_type1',
So that my second custom post type appears in the same admin menu as the first one. But the problem is that now my taxonomy isn't showing. If I put the object type to first custom post type, then it shows before my second CPT. But I need the taxonomy only for my second CPT. I've tried with
add_submenu_page(); but had no luck.
Is this possible?