Location Taxonomy
if ( ! function_exists( 'bta_destination_taxonomy' ) ) {
// Register Custom Taxonomy
function bta_destination_taxonomy() {
$labels = array(
'name' => _x( 'Destinations', 'Taxonomy General Name', 'bta' ),
'singular_name' => _x( 'Destination', 'Taxonomy Singular Name', 'bta' ),
'menu_name' => __( 'Destinations', 'bta' ),
'all_items' => __( 'All Destinations', 'bta' ),
'parent_item' => __( 'Parent Destination', 'bta' ),
'parent_item_colon' => __( 'Parent Destination:', 'bta' ),
'new_item_name' => __( 'New Destination Name', 'bta' ),
'add_new_item' => __( 'Add New Destination', 'bta' ),
'edit_item' => __( 'Edit Destination', 'bta' ),
'update_item' => __( 'Update Destination', 'bta' ),
'view_item' => __( 'View Destination', 'bta' ),
'separate_items_with_commas' => __( 'Separate destination with commas', 'bta' ),
'add_or_remove_items' => __( 'Add or remove destinations', 'bta' ),
'choose_from_most_used' => __( 'Choose from the most used destinations', 'bta' ),
'popular_items' => __( 'Popular Destinations', 'bta' ),
'search_items' => __( 'Search destinations', 'bta' ),
'not_found' => __( 'Not Found', 'bta' ),
'no_terms' => __( 'No destinations', 'bta' ),
'items_list' => __( 'Destinations list', 'bta' ),
'items_list_navigation' => __( 'Destinations list navigation', 'bta' ),
);
$rewrite = array(
'slug' => 'destination',
'with_front' => true,
'hierarchical' => false,
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'query_var' => 'bta_destination',
'rewrite' => $rewrite,
'show_in_rest' => true,
);
register_taxonomy( 'bta_destination', array( 'post', 'bta_tour' ), $args );
}
add_action( 'init', 'bta_destination_taxonomy', 0 );
}