lhoist-stay-safe__backend-t.../includes/taxonomy.php
2024-01-26 12:10:13 +01:00

30 lines
1.3 KiB
PHP

<?php
function add_custom_taxonomies() {
register_taxonomy('thematiques', 'post', array(
// 'hierarchical' => true,
// This array of options controls the labels displayed in the WordPress Admin UI
'labels' => array(
'name' => _x( 'Thématiques', 'taxonomy general name' ),
'singular_name' => _x( 'Thématique', 'taxonomy singular name' ),
'search_items' => __( 'Chercher une Thématique' ),
'all_items' => __( 'Toutes les Thématiques' ),
'parent_item' => __( 'Thématique Parent' ),
'parent_item_colon' => __( 'Thématique Parent:' ),
'edit_item' => __( 'Editer la Thématique' ),
'update_item' => __( 'Mettre à jour la Thématique' ),
'add_new_item' => __( 'Ajouter une Thématique' ),
'new_item_name' => __( 'Nom de la nouvelle Thématique' ),
'menu_name' => __( 'Thématiques' ),
),
// Control the slugs used for this taxonomy
'rewrite' => array(
'slug' => 'thematiques', // This controls the base slug that will display before each term
// 'with_front' => false, // Don't display the category base before "/locations/"
'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
),
));
}
add_action( 'init', 'add_custom_taxonomies', 0 );