From 6dd7476e8fce918016a902f82f1588ce8ce4225c Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 7 Nov 2023 10:15:47 +0100 Subject: [PATCH] updating news_type taxonomy to be better handled by javascript --- includes/taxonomy.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/taxonomy.php b/includes/taxonomy.php index dde2871..e69f9c3 100644 --- a/includes/taxonomy.php +++ b/includes/taxonomy.php @@ -80,7 +80,7 @@ function homegrade_add_custom_taxonomies() // ————— Type de news ————— - register_taxonomy('news-type', 'post', array( + register_taxonomy('news_type', 'post', array( 'labels' => array( 'name' => __('Types', 'homegrade-theme__texte-backoffice'), 'singular_name' => __('Type', 'homegrade-theme__texte-backoffice'), @@ -95,6 +95,11 @@ function homegrade_add_custom_taxonomies() 'menu_name' => __('Type', 'homegrade-theme__texte-backoffice'), ), 'hierarchical' => false, + 'show_in_rest' => true, + 'default_term' => [ + 'name' => ' Général', + 'slug' => 'general', + ], ));