Q:

Custom taxonomy is not working in custom post wordpress

How can I add taxonomy by using this code?
When I click on new taxonomy, I get an error
    function people_init() {
    // create a new taxonomy
    register_taxonomy(
        'people',
        'new_post',
        array(
            'label' => __( 'People' ),
            'rewrite' => array( 'slug' => 'person' ),
            'capabilities' => array(
                'assign_terms' => 'edit_guides',
                'edit_terms' => 'publish_guides'
            )
        )
    );
}add_action( 'init', 'people_init' );

This is the error message: 

You are not allowed to edit this item.

A:

try below code:
function people_init() {
// create a new taxonomy
register_taxonomy(
    'people',
    'new_post',
    array(
        'label' => __( 'People' ),
        'rewrite' => array( 'slug' => 'person' ),

    )
);
}add_action( 'init', 'people_init' );

