0

It seems not possible to write :

register_taxonomy('category',array('events'), array(
        'hierarchical'                  => true,
        'labels'                        => $labels_category_events,
        'show_ui'                       => true,
        'show_in_rest'                  => true,
        'show_admin_column'             => true,
        'query_var'                     => true,
        'rewrite'                       => array( 'slug' => "evenements/category" ),
        'has_archive'                   => true,
    ));

without having conflict with "real" categories ? Thank to confirm ... or not .

2

2 Answers 2

1

As said, you can't and here's the list of reserved terms: https://codex.wordpress.org/Reserved_Terms

0

No, as WordPress by default register a taxonomy called category (which is linked with blog posts). However, you can assign this taxonomy(category) to your custom post type too.
using the following code snippet.

add_action( 'init', 'pixel_add_category_cpt' );
function pixel_add_category_cpt() {
    register_taxonomy_for_object_type( 'events', 'course' );

}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.