I’ve had a look around for this but nothing has came up (perhaps am not searching good enough?) but I’m trying to set a parent on a taxonomy which is loaded from another taxonomy.
For example I have Car Makes and Car Models, when adding a new model I would like to select its parent (Car Make) not another parent within itself.
Makes cannot have any parents, but can have unlimited children, models cannot have any children and there parent must be a make.
Is this possible? Preferably without a plugin.
/* Makes */
$labels = array(
'name' => _x( 'Makes', 'taxonomy general name' ),
'singular_name' => _x( 'Make', 'taxonomy singular name' ),
'search_items' => __( 'Search Makes' ),
'all_items' => __( 'All Makes' ),
'parent_item' => __( 'Parent Make' ),
'parent_item_colon' => __( 'Parent Make:' ),
'edit_item' => __( 'Edit Make' ),
'update_item' => __( 'Update Make' ),
'add_new_item' => __( 'Add New Make' ),
'new_item_name' => __( 'New Make' ),
);
register_taxonomy('makes', 'car', array('hierarchical' => false, 'labels' => $labels, 'query_var' => false, 'rewrite' => false, 'with_front' => false));
/* Models */
$labels = array(
'name' => _x( 'Models', 'taxonomy general name' ),
'singular_name' => _x( 'Model', 'taxonomy singular name' ),
'search_items' => __( 'Search Models' ),
'all_items' => __( 'All Models' ),
'parent_item' => __( 'Parent Model' ),
'parent_item_colon' => __( 'Parent Model:' ),
'edit_item' => __( 'Edit Model' ),
'update_item' => __( 'Update Model' ),
'add_new_item' => __( 'Add New Model' ),
'new_item_name' => __( 'New Model' )
);
register_taxonomy('models', 'car', array('hierarchical' => true, 'labels' => $labels, 'query_var' => false, 'rewrite' => false, 'with_front' => false));
This question is slightly related: Show WordPress Custom Taxonomy Items Based On a Selected Item From Another Custom Taxonomy however I assume the parent/child elements are from one taxonomy? In my case they need to be two separate taxonomies.