<?php
/** Register portfolios categories taxonomy **/
add_action('init', 'register_portfolio_category', 0);
function register_portfolio_category()
{
    $labels = array(
        'name' => __( 'Portfolio Categories', TEXT_DOMAIN ),
        'singular_name' => __( 'Portfolio Category', TEXT_DOMAIN),
        'search_items' =>  __( 'Search Portfolio Categories',TEXT_DOMAIN ),
        'all_items' => __( 'All Portfolio Categories',TEXT_DOMAIN ),
        'parent_item' => __( 'Parent Portfolio Category',TEXT_DOMAIN ),
        'parent_item_colon' => __( 'Parent Portfolio Category:',TEXT_DOMAIN ),
        'edit_item' => __( 'Edit Portfolio Category',TEXT_DOMAIN ),
        'update_item' => __( 'Update Portfolio Category',TEXT_DOMAIN ),
        'add_new_item' => __( 'Add New Portfolio Category',TEXT_DOMAIN ),
        'new_item_name' => __( 'New Portfolio Category Name',TEXT_DOMAIN ),
        'menu_name' => __( 'Portfolio Categories',TEXT_DOMAIN ),
    );
    register_taxonomy('portfolio_cat', array('portfolios'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array('slug' => 'portfolio_cat'),
        'show_in_rest' => true,
        'rest_base' => 'portfolio_cat',
    ));
}


/** Register stories categories taxonomy **/
add_action('init', 'register_story_category', 0);
function register_story_category()
{
    $labels = array(
        'name' => __( 'Story Categories', TEXT_DOMAIN ),
        'singular_name' => __( 'Story Category', TEXT_DOMAIN),
        'search_items' =>  __( 'Search Story Categories',TEXT_DOMAIN ),
        'all_items' => __( 'All Story Categories',TEXT_DOMAIN ),
        'parent_item' => __( 'Parent Story Category',TEXT_DOMAIN ),
        'parent_item_colon' => __( 'Parent Story Category:',TEXT_DOMAIN ),
        'edit_item' => __( 'Edit Story Category',TEXT_DOMAIN ),
        'update_item' => __( 'Update Story Category',TEXT_DOMAIN ),
        'add_new_item' => __( 'Add New Story Category',TEXT_DOMAIN ),
        'new_item_name' => __( 'New Story Category Name',TEXT_DOMAIN ),
        'menu_name' => __( 'Story Categories',TEXT_DOMAIN ),
    );
    register_taxonomy('story_cat', array('stories'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array('slug' => 'story_cat'),
        'show_in_rest' => true,
        'rest_base' => 'story_cat',
    ));
}

