<?php

/**
 * Champagnes (Vins) Custom Post Type
 * Laurent-Perrier Theme
 */

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

/**
 * Register Champagnes (Vins) Custom Post Type
 */
function lp_register_vins_post_type()
{
    $labels = array(
        'name'                  => _x('vins', 'Post type general name', 'laurentperrier'),
        'singular_name'         => _x('Champagne', 'Post type singular name', 'laurentperrier'),
        'menu_name'             => _x('Champagnes', 'Admin Menu text', 'laurentperrier'),
        'name_admin_bar'        => _x('Champagne', 'Add New on Toolbar', 'laurentperrier'),
        'add_new'               => __('Ajouter', 'laurentperrier'),
        'add_new_item'          => __('Ajouter un Champagne', 'laurentperrier'),
        'new_item'              => __('Nouveau Champagne', 'laurentperrier'),
        'edit_item'             => __('Éditer le Champagne', 'laurentperrier'),
        'view_item'             => __('Voir le Champagne', 'laurentperrier'),
        'view_items'            => __('Voir les Champagnes', 'laurentperrier'),
        'all_items'             => __('Tous les Champagnes', 'laurentperrier'),
        'search_items'          => __('Rechercher un Champagne', 'laurentperrier'),
        'parent_item_colon'     => __('Champagne parent:', 'laurentperrier'),
        'not_found'             => __('Aucun champagne trouvé', 'laurentperrier'),
        'not_found_in_trash'    => __('Aucun champagne trouvé dans la corbeille', 'laurentperrier'),
        'featured_image'        => _x('Image du Champagne', 'Overrides the "Featured Image" phrase', 'laurentperrier'),
        'set_featured_image'    => _x('Définir l\'image du champagne', 'Overrides the "Set featured image" phrase', 'laurentperrier'),
        'remove_featured_image' => _x('Supprimer l\'image du champagne', 'Overrides the "Remove featured image" phrase', 'laurentperrier'),
        'use_featured_image'    => _x('Utiliser comme image du champagne', 'Overrides the "Use as featured image" phrase', 'laurentperrier'),
        'archives'              => _x('Archives des Champagnes', 'The post type archive label', 'laurentperrier'),
        'insert_into_item'      => _x('Insérer dans le champagne', 'Overrides the "Insert into post" phrase', 'laurentperrier'),
        'uploaded_to_this_item' => _x('Téléchargé vers ce champagne', 'Overrides the "Uploaded to this post" phrase', 'laurentperrier'),
        'filter_items_list'     => _x('Filtrer la liste des champagnes', 'Screen reader text for the filter links', 'laurentperrier'),
        'items_list_navigation' => _x('Navigation de la liste des champagnes', 'Screen reader text for the pagination', 'laurentperrier'),
        'items_list'            => _x('Liste des champagnes', 'Screen reader text for the items list', 'laurentperrier'),
    );

    $args = array(
        'labels'             => $labels,
        'public'             => true,
        'publicly_queryable' => true,
        'show_ui'            => true,
        'show_in_menu'       => true,
        'show_in_nav_menus'  => true,
        'show_in_admin_bar'  => true,
        'show_in_rest'       => true,
        'query_var'          => true,
        'rewrite'            => array(
            'slug' => 'champagnes',
            'with_front' => false,
        ),
        'capability_type'    => 'post',
        'has_archive'        => true,
        'hierarchical'       => false,
        'menu_position'      => 7,
        'menu_icon'          => 'dashicons-star-filled',
        'supports'           => array(
            'title',
            'editor',
            'excerpt',
            'thumbnail',
            'custom-fields',
            'page-attributes',
            'revisions',
        ),
        'taxonomies'         => array(),
        'can_export'         => true,
        'delete_with_user'   => false,
    );

    register_post_type('vins', $args);
}

// Hook into the 'init' action
add_action('init', 'lp_register_vins_post_type', 0);
