CPT Recipe – Taxonomy Cuisine
if ( ! function_exists( 'wpbscook_register_taxonomy_recipe_cuisine' ) ) {
// Register Custom Taxonomy
function wpbscook_register_taxonomy_recipe_cuisine() {
$labels = array(
'name' => _x( 'Cuisine', 'Taxonomy General Name', 'wpbscook' ),
'singular_name' => _x( 'Cuisine', 'Taxonomy Singular Name', 'wpbscook' ),
'menu_name' => __( 'Cuisine', 'wpbscook' ),
'all_items' => __( 'All cuisine', 'wpbscook' ),
'parent_item' => __( 'Parent cuisine', 'wpbscook' ),
'parent_item_colon' => __( 'Parent cuisine:', 'wpbscook' ),
'new_item_name' => __( 'New cuisine name', 'wpbscook' ),
'add_new_item' => __( 'Add new cuisine', 'wpbscook' ),
'edit_item' => __( 'Edit cuisine', 'wpbscook' ),
'update_item' => __( 'Update cuisine', 'wpbscook' ),
'separate_items_with_commas' => __( 'Separate cuisine with commas', 'wpbscook' ),
'search_items' => __( 'Search cuisine', 'wpbscook' ),
'add_or_remove_items' => __( 'Add or remove cuisine', 'wpbscook' ),
'choose_from_most_used' => __( 'Choose from the most used cuisine', 'wpbscook' ),
'not_found' => __( 'Not Found', 'wpbscook' ),
);
$rewrite = array(
'slug' => 'recipe_cuisine',
'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,
'rewrite' => $rewrite,
);
register_taxonomy( 'wpbscook_cuisine', array( 'wpbscook_recipe' ), $args );
}
// Hook into the 'init' action
add_action( 'init', 'wpbscook_register_taxonomy_recipe_cuisine', 0 );
}