adding new taxoniomy for news
This commit is contained in:
parent
9851d1f488
commit
228a6435c0
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
/* -----------------------
|
||||
HIDE DEFAULT TAXONOMIES
|
||||
------------------------------------------------------------------------*/
|
||||
-------------------------*/
|
||||
function wpsnipp_remove_default_taxonomies()
|
||||
{
|
||||
global $pagenow;
|
||||
|
|
@ -22,9 +23,9 @@ add_action('init', 'wpsnipp_remove_default_taxonomies');
|
|||
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ---------------------------------
|
||||
OTHER THAN ADMIN CANNOT CREATE TAGS
|
||||
------------------------------------------------------------------------*/
|
||||
-----------------------------------*/
|
||||
add_action('create_term', 'undo_create_term', 10, 3);
|
||||
|
||||
function undo_create_term($term_id, $tt_id, $taxonomy)
|
||||
|
|
@ -37,12 +38,14 @@ function undo_create_term($term_id, $tt_id, $taxonomy)
|
|||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* -------------------
|
||||
REGISTER TAXONOMIES
|
||||
------------------------------------------------------------------------*/
|
||||
--------------------*/
|
||||
|
||||
function add_custom_taxonomies()
|
||||
function homegrade_add_custom_taxonomies()
|
||||
{
|
||||
|
||||
|
||||
// ————— Thématiques —————
|
||||
register_taxonomy('thematiques', ['questions', 'conseils', 'brochures', 'fiches-infos'], array(
|
||||
// 'hierarchical' => true,
|
||||
|
|
@ -76,6 +79,24 @@ function add_custom_taxonomies()
|
|||
));
|
||||
|
||||
|
||||
// ————— Type de news —————
|
||||
register_taxonomy('news-type', 'post', array(
|
||||
'labels' => array(
|
||||
'name' => __('Types', 'homegrade-theme__texte-backoffice'),
|
||||
'singular_name' => __('Type', 'homegrade-theme__texte-backoffice'),
|
||||
'search_items' => __('Chercher un Type', 'homegrade-theme__texte-backoffice'),
|
||||
'all_items' => __('Tous les Types', 'homegrade-theme__texte-backoffice'),
|
||||
'parent_item' => __('Type Parent', 'homegrade-theme__texte-backoffice'),
|
||||
'parent_item_colon' => __('Type Parent:', 'homegrade-theme__texte-backoffice'),
|
||||
'edit_item' => __('Editer le Type', 'homegrade-theme__texte-backoffice'),
|
||||
'update_item' => __('Mettre à jour le Type', 'homegrade-theme__texte-backoffice'),
|
||||
'add_new_item' => __('Ajouter un Type', 'homegrade-theme__texte-backoffice'),
|
||||
'new_item_name' => __('Nom du nouveau Type', 'homegrade-theme__texte-backoffice'),
|
||||
'menu_name' => __('Type', 'homegrade-theme__texte-backoffice'),
|
||||
),
|
||||
'hierarchical' => false,
|
||||
));
|
||||
|
||||
// ————— mots-clés —————
|
||||
register_taxonomy('mots-cles', ['questions', 'conseils'], array(
|
||||
|
||||
|
|
@ -100,11 +121,11 @@ function add_custom_taxonomies()
|
|||
|
||||
));
|
||||
}
|
||||
add_action('init', 'add_custom_taxonomies', 0);
|
||||
add_action('init', 'homegrade_add_custom_taxonomies', 0);
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* -----------------------
|
||||
HIDE THEMATIQUE METABOX
|
||||
------------------------------------------------------------------------*/
|
||||
-------------------------*/
|
||||
// on passe le metabox_cb à false pour ne pas afficher la metabox
|
||||
function tna_edit_taxonomy_args($args, $tax_slug, $cptui_tax_args)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user