Can I use the ‘category’ taxonomy for both posts and a custom post type?

Question

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.

0
Alexnl 5 months 2022-07-11T19:44:07-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse