fail to register new posttype and new taxonomie

2019-09-06 20:01发布

问题:

this is my code and i'm in a serios problem with it : any help please. first i have registered the post type and second i have registered the taxonomie an always i got invalid taxonomies error

add_action('init', 'create_categorie_video_tax');

function create_categorie_video_tax()
{
    register_post_type('video',
        array(
            'labels' => array(
                'name' => 'video',
                'singular_name' => 'video'
            ),
            'public' => true,
            'has_archive' => true,
        )
    );

    register_taxonomy(
        'categorie-video',
        'video',
        array(
            'label' => 'categorie-video',
            'rewrite' => array('slug' => 'video'),
            'hierarchical' => true,
        )
    );
}