declaring custom taxonomies
This commit is contained in:
parent
8ed300f823
commit
46284d8e07
|
|
@ -1,26 +1,66 @@
|
|||
<?php
|
||||
|
||||
// Catégories custom post type
|
||||
register_taxonomy(
|
||||
'customer', /* Voici donc la taxonomie */
|
||||
array('customer'), /* nom du custom post type */
|
||||
array(
|
||||
'hierarchical' => true,
|
||||
|
||||
|
||||
// ######################@
|
||||
|
||||
|
||||
/* -------------------
|
||||
REGISTER TAXONOMIES
|
||||
--------------------*/
|
||||
|
||||
function homegrade_add_custom_taxonomies()
|
||||
{
|
||||
|
||||
|
||||
// ————— Thématiques —————
|
||||
register_taxonomy('project_type', ['portfolio'], array(
|
||||
// 'hierarchical' => true,
|
||||
'labels' => array(
|
||||
'name' => __('Catégories', 'customer'),
|
||||
'singular_name' => __('Catégories', 'nom du theme'),
|
||||
'search_items' => __('Rechercher une catégorie', 'nom du theme'),
|
||||
'all_items' => __('Toutes les catégories', 'nom du theme'),
|
||||
'parent_item' => __('Catégorie parente', 'nom du theme'),
|
||||
'parent_item_colon' => __('Catégorie parente :', 'nom du theme'),
|
||||
'edit_item' => __('Éditer une catégorie', 'nom du theme'),
|
||||
'update_item' => __('Sauvegarder une catégorie', 'nom du theme'),
|
||||
'add_new_item' => __('Ajouter une catégorie', 'nom du theme'),
|
||||
'new_item_name' => __('Nouvelle catégorie', 'nom du theme')
|
||||
'name' => __('Type de projet', 'deligraph-theme'),
|
||||
'singular_name' => __('Type de projet', 'deligraph-theme'),
|
||||
'search_items' => __('Chercher un type de projet', 'deligraph-theme'),
|
||||
'all_items' => __('Touts les Types de projet', 'deligraph-theme'),
|
||||
'parent_item' => __('Type de projet Parent', 'deligraph-theme'),
|
||||
'parent_item_colon' => __('Type de projet Parent:', 'deligraph-theme'),
|
||||
'edit_item' => __('Editer le Type de projet', 'deligraph-theme'),
|
||||
'update_item' => __('Mettre à jour le Type de projet', 'deligraph-theme'),
|
||||
'add_new_item' => __('Ajouter un Type de projet', 'deligraph-theme'),
|
||||
'new_item_name' => __('Nom du nouveau Type de projet', 'deligraph-theme'),
|
||||
'menu_name' => __('Type de projet', 'deligraph-theme'),
|
||||
),
|
||||
'show_admin_column' => true,
|
||||
'show_ui' => true,
|
||||
'query_var' => true,
|
||||
'rewrite' => array('slug' => 'customer'),
|
||||
)
|
||||
);
|
||||
'public' => true,
|
||||
'show_in_rest' => true,
|
||||
'show_ui' => true,
|
||||
'show_admin_column' => false,
|
||||
'show_in_quick_edit' => false,
|
||||
'meta_box_cb' => false,
|
||||
'hierarchical' => false,
|
||||
));
|
||||
|
||||
|
||||
register_taxonomy(
|
||||
'customer', /* Voici donc la taxonomie */
|
||||
array('customer'), /* nom du custom post type */
|
||||
array(
|
||||
'hierarchical' => true,
|
||||
'labels' => array(
|
||||
'name' => __('Catégories', 'customer'),
|
||||
'singular_name' => __('Catégories', 'nom du theme'),
|
||||
'search_items' => __('Rechercher une catégorie', 'nom du theme'),
|
||||
'all_items' => __('Toutes les catégories', 'nom du theme'),
|
||||
'parent_item' => __('Catégorie parente', 'nom du theme'),
|
||||
'parent_item_colon' => __('Catégorie parente :', 'nom du theme'),
|
||||
'edit_item' => __('Éditer une catégorie', 'nom du theme'),
|
||||
'update_item' => __('Sauvegarder une catégorie', 'nom du theme'),
|
||||
'add_new_item' => __('Ajouter une catégorie', 'nom du theme'),
|
||||
'new_item_name' => __('Nouvelle catégorie', 'nom du theme')
|
||||
),
|
||||
'show_admin_column' => true,
|
||||
'show_ui' => true,
|
||||
'query_var' => true,
|
||||
'rewrite' => array('slug' => 'customer'),
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'homegrade_add_custom_taxonomies', 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user