Dish custom post
if ( ! function_exists('dishes_post_type') ) {
// Register Custom Post Type
function dishes_post_type() {
$labels = array(
'name' => 'Plats',
'singular_name' => 'Plat',
'menu_name' => 'Liste des plats',
'name_admin_bar' => 'Liste des plats',
'parent_item_colon' => 'Parent Product:',
'all_items' => 'Tous les plats',
'add_new_item' => 'Ajouter nouveau plat',
'add_new' => 'Nouveau plat',
'new_item' => 'Nouvel élément',
'edit_item' => 'Modifier plat',
'update_item' => 'Actualiser plat',
'view_item' => 'Afficher élément',
'search_items' => 'Chercher plats',
'not_found' => 'Aucun plat trouvé',
'not_found_in_trash' => 'Aucun plat trouvé dans la poubelle',
);
$args = array(
'label' => 'Plat',
'description' => 'Liste des plats',
'labels' => $labels,
'supports' => array( 'title', 'author', 'thumbnail', 'trackbacks', ),
'taxonomies' => array( 'entree', ' viande', ' poisson', ' dessert' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-carrot',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'dish', $args );
}
add_action( 'init', 'dishes_post_type', 0 );
}