CLI-BRI excursions_post_type
if ( ! function_exists('excursions_post_type') ) {
// Register Custom Post Type
function excursions_post_type() {
$labels = array(
'name' => _x( 'Excursions', 'Post Type General Name', 'ttc' ),
'singular_name' => _x( 'Excursion', 'Post Type Singular Name', 'ttc' ),
'menu_name' => __( 'Excursions', 'ttc' ),
'name_admin_bar' => __( 'Excursions', 'ttc' ),
'archives' => __( 'Excursions Archives', 'ttc' ),
'attributes' => __( 'Excursions Attributes', 'ttc' ),
'parent_item_colon' => __( 'Parent Item:', 'ttc' ),
'all_items' => __( 'Toutes les Excursions', 'ttc' ),
'add_new_item' => __( 'Ajouter une nouvelle Excursion', 'ttc' ),
'add_new' => __( 'Ajouter une Excursion', 'ttc' ),
'new_item' => __( 'Nouvelle Excursion', 'ttc' ),
'edit_item' => __( 'Modifier Excursion', 'ttc' ),
'update_item' => __( 'Mettre à jour Excursion', 'ttc' ),
'view_item' => __( 'Voir Excursion', 'ttc' ),
'view_items' => __( 'Voir les Excursions', 'ttc' ),
'search_items' => __( 'Chercher une Excursion', 'ttc' ),
'not_found' => __( 'Not found', 'ttc' ),
'not_found_in_trash' => __( 'Not found in Trash', 'ttc' ),
'featured_image' => __( 'Featured Image', 'ttc' ),
'set_featured_image' => __( 'Set featured image', 'ttc' ),
'remove_featured_image' => __( 'Remove featured image', 'ttc' ),
'use_featured_image' => __( 'Use as featured image', 'ttc' ),
'insert_into_item' => __( 'Insert into item', 'ttc' ),
'uploaded_to_this_item' => __( 'Uploaded to this item', 'ttc' ),
'items_list' => __( 'Items list', 'ttc' ),
'items_list_navigation' => __( 'Items list navigation', 'ttc' ),
'filter_items_list' => __( 'Filter items list', 'ttc' ),
);
$args = array(
'label' => __( 'Excursion', 'ttc' ),
'description' => __( 'les excursions organisées proposées', 'ttc' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'comments' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 25,
'menu_icon' => 'dashicons-palmtree',
'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',
);
register_post_type( 'excursions', $args );
}
add_action( 'init', 'excursions_post_type', 0 );
}