<?php


function cpt_customer()
{

	register_post_type(
		'customer',
		array(
			'label' => __('Customers'),
			'singular_label' => __('Customer'),
			'public' => true,
			'show_ui' => true,
			'_builtin' => false,
			'_edit_link' => 'post.php?post=%d',
			'capability_type' => 'post',
			'hierarchical' => false,
			'rewrite' => array("slug" => "customers"),
			'query_var' => "customers",
			'supports' => array('title', 'editor', 'thumbnail') //titre + zone de texte + champs personnalisés + miniature valeur possible : 'title','editor','author','thumbnail','excerpt'
		)
	);
	register_taxonomy_for_object_type('post_tag', 'customer', 'show_tagcloud=1&hierarchical=true');


	register_post_type(
		'portfolio',
		array(
			'label' => __('Portfolio'),
			'singular_label' => __('Portfolio'),
			'public' => true,
			'menu_icon'           => 'dashicons-forms',
			'show_ui' => true,
			'hierarchical' => false,
			'supports' => array('title', 'thumbnail', 'editor', 'excerpt', 'custom-fields', 'revisions', 'page-attributes'),
			'show_in_rest'       => true, // Active l'éditeur de blocs (Gutenberg).

		)
	);
}
add_action('init', 'cpt_customer');

function my_custom_post_type() {}

add_action('init', 'my_custom_post_type');
