0

Is there a disadvantage or issue with using the category taxonomy that post uses with a custom post type? For example:

$args = array(
    'label'                 => __( 'Item', 'text_domain' ),
    'description'           => __( 'Add an Item', 'text_domain' ),
    'labels'                => $labels,
    'supports'              => array( 'title', 'revisions', 'custom-fields', 'thumbnail', 'page-attributes'),
    'taxonomies'            => array('category'),
    'hierarchical'          => false,
    'public'                => true,
    'show_ui'               => true,
    'show_in_menu'          => true,
    'menu_position'         => 5,
    'menu_icon'             => 'dashicons-edit',
    'show_in_admin_bar'     => true,
    'show_in_nav_menus'     => true,
    'show_in_rest'          => true,
    'can_export'            => true,
    'has_archive'           => true,        
    'exclude_from_search'   => false,
    'publicly_queryable'    => true,
    'capability_type'       => 'post',
);
register_post_type( 'item', $args );

The website will also have a blog using the post type.

1
  • 1
    There shouldn't be any issues or real disadvantages, but there are very few scenarios when this approach is recommended from practical point of view (rather than assigning custom taxonomy to your post type). What is your scenario? Jul 12 at 5:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.