So I’m not sure what I can provide to help replicate this except for paste the two definitions. I can confirm that for me, removing the meta_box_cb results in the duplicates appearing. Adding it back in makes it work properly. It’s odd as the DOM of the edit page in both scenarios is identical, so I suspect you are right – something else is listening to the save maybe and causing issues. Here’s the definition of both. I tried removing one by the way and it happens with just one box enabled, so I’m not sure having multiple is the issue.
/* Article Type */
$labels = array(
'name' => _x( 'Article Type', 'taxonomy general name', 'sage' ),
'singular_name' => _x( 'Article Type', 'taxonomy singular name', 'sage' ),
'search_items' => __( 'Search Article Types', 'sage' ),
'all_items' => __( 'All Article Types', 'sage' ),
'parent_item' => __( 'Parent Article Type', 'sage' ),
'parent_item_colon' => __( 'Parent Article Type:', 'sage' ),
'edit_item' => __( 'Edit Article Type', 'sage' ),
'update_item' => __( 'Update Article Type', 'sage' ),
'add_new_item' => __( 'Add New Article Type', 'sage' ),
'new_item_name' => __( 'New Article Type Name', 'sage' ),
'menu_name' => __( 'Article Types', 'sage' ),
);
$args = array(
'hierarchical' => false,
'labels' => $labels,
'public' => true,
'show_admin_column' => true,
'meta_box_cb' => 'post_categories_meta_box',
'rewrite' => array( 'slug' => __( 'article-type', 'sage' ) ),
);
register_taxonomy( 'article_type', array( 'post' ), $args );
/* Access Type */
$labels = array(
'name' => _x( 'Access Type', 'taxonomy general name', 'sage' ),
'singular_name' => _x( 'Access Type', 'taxonomy singular name', 'sage' ),
'search_items' => __( 'Search Access Types', 'sage' ),
'all_items' => __( 'All Access Types', 'sage' ),
'parent_item' => __( 'Parent Access Type', 'sage' ),
'parent_item_colon' => __( 'Parent Access Type:', 'sage' ),
'edit_item' => __( 'Edit Access Type', 'sage' ),
'update_item' => __( 'Update Access Type', 'sage' ),
'add_new_item' => __( 'Add New Access Type', 'sage' ),
'new_item_name' => __( 'New Access Type Name', 'sage' ),
'menu_name' => __( 'Access Types', 'sage' ),
);
$args = array(
'hierarchical' => false,
'labels' => $labels,
'public' => true,
'publicly_queryable' => false,
'show_ui' => true,
'show_admin_column' => true,
'meta_box_cb' => 'post_categories_meta_box',
'rewrite' => array( 'slug' => __( 'access-type', 'sage' ) ),
);
register_taxonomy( 'access_type', array( 'post', 'page' ), $args );
If you’d like anything else do let me know! Or if you have any idea how I could find the hidden listener/function maybe?
Thanks!
-
This reply was modified 1 year, 8 months ago by ralpharama.