Opportunité
// Register Custom Post Type
function register_opportunity() {
$labels = array(
'name' => _x( 'Opportunités', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Opportunité', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Opportunités', 'text_domain' ),
'name_admin_bar' => __( 'Opportunité', 'text_domain' ),
'archives' => __( 'Archive des opportunités', 'text_domain' ),
'attributes' => __( 'Atttributs des opportunités', 'text_domain' ),
'parent_item_colon' => __( 'Opportunité parente', 'text_domain' ),
'all_items' => __( 'Toutes les opportunités', 'text_domain' ),
'add_new_item' => __( 'Créer une opportunité', 'text_domain' ),
'add_new' => __( 'Créer la nouvelle opportunité', 'text_domain' ),
'new_item' => __( 'Nouvelle opportunité', 'text_domain' ),
'edit_item' => __( 'Modifier l'opportunité', 'text_domain' ),
'update_item' => __( 'Mettre à jour l'opportunité', 'text_domain' ),
'view_item' => __( 'Voir l'opportunité', 'text_domain' ),
'view_items' => __( 'Voir les opportunités', 'text_domain' ),
'search_items' => __( 'Rechercher une opportunité', 'text_domain' ),
'not_found' => __( 'Opportunité non trouvée', 'text_domain' ),
'not_found_in_trash' => __( 'Opportunité non trouvée dans la poubelle', 'text_domain' ),
'featured_image' => __( 'Image liée à l'opportunité', 'text_domain' ),
'set_featured_image' => __( 'Choisir l'image liée à l'opportunité', 'text_domain' ),
'remove_featured_image' => __( 'Supprimer l'image liée à l'opportunité', 'text_domain' ),
'use_featured_image' => __( 'Utiliser comme image liée à l'opportunité', 'text_domain' ),
'insert_into_item' => __( 'Ajouter à l'opportunité', 'text_domain' ),
'uploaded_to_this_item' => __( 'Ajouté à l'opportunité', 'text_domain' ),
'items_list' => __( 'Liste des opportunités', 'text_domain' ),
'items_list_navigation' => __( 'Liste des opportunités', 'text_domain' ),
'filter_items_list' => __( 'Filtrer les opportunités', 'text_domain' ),
);
$capabilities = array(
'edit_post' => 'edit_opportunity',
'read_post' => 'edit_opportunity',
'delete_post' => 'edit_opportunity',
'edit_posts' => 'edit_opportunity',
'edit_others_posts' => 'edit_others_opportunity',
'publish_posts' => 'edit_others_opportunity',
'read_private_posts' => 'edit_opportunity',
);
$args = array(
'label' => __( 'Opportunité', 'text_domain' ),
'description' => __( 'Opportunité d'avoir une demande de service', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'comments', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-media-spreadsheet',
'show_in_admin_bar' => true,
'show_in_nav_menus' => false,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'rewrite' => false,
'capabilities' => $capabilities,
'show_in_rest' => false,
);
register_post_type( 'opportunity', $args );
}
add_action( 'init', 'register_opportunity', 0 );