Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

L’Emplacement

if ( ! function_exists('custom_post_type_espaces') ) {

// Register Custom Post Type
function custom_post_type_espaces() {

	$labels = array(
		'name'                  => _x( 'espaces', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'espace', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Espaces', 'text_domain' ),
		'name_admin_bar'        => __( 'Espace', 'text_domain' ),
		'archives'              => __( 'Tous les espaces', 'text_domain' ),
		'attributes'            => __( 'Options des espaces', 'text_domain' ),
		'parent_item_colon'     => __( 'Parent Item:', 'text_domain' ),
		'all_items'             => __( 'Tous les espaces', 'text_domain' ),
		'add_new_item'          => __( 'Ajouter un nouvel espace', 'text_domain' ),
		'add_new'               => __( 'Ajouter un nouveau', 'text_domain' ),
		'new_item'              => __( 'Nouvel espace', 'text_domain' ),
		'edit_item'             => __( 'Modifier l'espace', 'text_domain' ),
		'update_item'           => __( 'Mettre à jour l'espace', 'text_domain' ),
		'view_item'             => __( 'Voir l'espace', 'text_domain' ),
		'view_items'            => __( 'Voir les espaces', 'text_domain' ),
		'search_items'          => __( 'Rechercher un espace', 'text_domain' ),
		'not_found'             => __( 'Aucun espace trouvé', 'text_domain' ),
		'not_found_in_trash'    => __( 'Pas d'espace dans la corbeille', 'text_domain' ),
		'featured_image'        => __( 'Image phare de l'espace', 'text_domain' ),
		'set_featured_image'    => __( 'Modifier l'image phare de l'espace', 'text_domain' ),
		'remove_featured_image' => __( 'Supprimer l'image phare de l'espace', 'text_domain' ),
		'use_featured_image'    => __( 'Utiliser comme image phare', 'text_domain' ),
		'insert_into_item'      => __( 'Ajouter à l'espace', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Ajouté à l'espace', 'text_domain' ),
		'items_list'            => __( 'Liste des espaces', 'text_domain' ),
		'items_list_navigation' => __( 'Menu des espaces', 'text_domain' ),
		'filter_items_list'     => __( 'Filtrer la liste des espaces', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'espace', 'text_domain' ),
		'description'           => __( 'Boutique éphémère | Pop-up Store | Corner | Espace de vente', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes' ),
		'taxonomies'            => array( 'a', 'b', 'c' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-store',
		'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',
		'show_in_rest'          => true,
	);
	register_post_type( 'espaces', $args );

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

}