ARTICLE AD BOX
I have created a custom post type "Model" and a corresponding custom taxonomy "Domain" in a WordPress plugin.
register_taxonomy( 'domain', array( 'model' ), array( 'label' => 'Domain', 'hierarchical' => true, // ... 'rewrite' => array( 'slug' => 'domains' ), ) ); // ... register_post_type( 'model', array( 'label' => 'Model', 'hierarchical' => false, // ... 'taxonomies' => array( 'domain' ), 'rewrite' => array( 'slug' => 'models' ), ) );When I register the taxonomy menu in the admin menu I get the WordPress generated page to edit taxonomy terms.
add_submenu_page( 'my-top-level-menu', __( 'Domains', 'my-plugin-slug' ), __( 'Domains', 'my-plugin-slug' ), 'manage_domains', 'edit-tags.php?taxonomy=domain' );In the autogenerated page, the term list table contains a link to the route /wp-admin/edit.php?domain=default. However, when requesting this route, I get built-in posts list instead of models posts.
I guess WordPress sets default post type 'post' in 'edit.php' if no 'post_type' is set in the URL query args. How to manage the wrong default post type for the taxonomy?
