SH PP (year) categoty
if ( ! function_exists( 'year_date_categories' ) ) {
// Register Custom Taxonomy
function year_date_categories() {
$labels = array(
'name' => 'Year (Date)',
'singular_name' => 'Year (Date)',
'menu_name' => 'Date (year)',
'all_items' => 'All Years',
'parent_item' => 'Parent Item',
'parent_item_colon' => 'Parent Item:',
'new_item_name' => 'New Year',
'add_new_item' => 'Add New Year',
'edit_item' => 'Edit Year',
'update_item' => 'Update Year',
'view_item' => 'View Year',
'separate_items_with_commas' => 'Separate items with commas',
'add_or_remove_items' => 'Add or remove items',
'choose_from_most_used' => 'Choose from the most used',
'popular_items' => 'Popular Items',
'search_items' => 'Search Items',
'not_found' => 'Not Found',
'no_terms' => 'No items',
'items_list' => 'Items list',
'items_list_navigation' => 'Items list navigation',
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => false,
'show_tagcloud' => false,
'show_in_rest' => true,
);
register_taxonomy( 'year_date', array( 'newsletter' ), $args );
}
add_action( 'init', 'year_date_categories', 0 );
}