Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Test Menu Restaurant

if ( ! function_exists('az_custom_post_type') ) {

// Register Custom Post Type
function az_custom_post_type() {

	$labels = array(
		'name'                  => _x( 'Nos Plats', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Plat', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Notre Carte', 'text_domain' ),
		'name_admin_bar'        => __( 'Nouveau plat', 'text_domain' ),
		'archives'              => __( 'POI Archives', 'text_domain' ),
		'attributes'            => __( 'POI Attributes', 'text_domain' ),
		'parent_item_colon'     => __( 'POI Parent Item', 'text_domain' ),
		'all_items'             => __( 'Tous les plats', 'text_domain' ),
		'add_new_item'          => __( 'Nouveau plat', 'text_domain' ),
		'add_new'               => __( 'Ajouter un plat', 'text_domain' ),
		'new_item'              => __( 'POI New Item', 'text_domain' ),
		'edit_item'             => __( 'Editer le plat', 'text_domain' ),
		'update_item'           => __( 'Mettre à jour le plat', 'text_domain' ),
		'view_item'             => __( 'Voir le plat', 'text_domain' ),
		'view_items'            => __( 'Voir la Carte', 'text_domain' ),
		'search_items'          => __( 'Rechercher', 'text_domain' ),
		'not_found'             => __( 'Aucun plat', 'text_domain' ),
		'not_found_in_trash'    => __( 'POI Not found in Trash', 'text_domain' ),
		'featured_image'        => __( 'POI Featured Image', 'text_domain' ),
		'set_featured_image'    => __( 'POI Set featured image', 'text_domain' ),
		'remove_featured_image' => __( 'POI Remove featured image', 'text_domain' ),
		'use_featured_image'    => __( 'POI Use as featured image', 'text_domain' ),
		'insert_into_item'      => __( 'POI Insert into item', 'text_domain' ),
		'uploaded_to_this_item' => __( 'POI Uploaded to this item', 'text_domain' ),
		'items_list'            => __( 'POI Items list', 'text_domain' ),
		'items_list_navigation' => __( 'POI Items list navigation', 'text_domain' ),
		'filter_items_list'     => __( 'POI Filter items list', 'text_domain' ),
	);
	$rewrite = array(
		'slug'                  => 'poiurlslug',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'Plat', 'text_domain' ),
		'description'           => __( 'Description du plat', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor' ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => true,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => true,
		'has_archive'           => 'TOTOTATA',
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'rewrite'               => $rewrite,
		'capability_type'       => 'page',
		'show_in_rest'          => false,
	);
	register_post_type( 'POI Type Key', $args );

}
add_action( 'init', 'az_custom_post_type', 0 );

}