diff --git a/functions.php b/functions.php index 5de597d..090f076 100644 --- a/functions.php +++ b/functions.php @@ -26,28 +26,88 @@ * Permet d'afficher les niveaux de post pour les post features */ +// 1.1 - Enregistrement de la taxonomy pour le flag register_taxonomy( - 'niveau', + 'flag', 'post', array( - 'label' => 'Niveau', + 'label' => 'Flag', 'labels' => array( - 'name' => 'Niveaux', - 'singular_name' => 'Niveaux', - 'all_items' => 'Tous les niveaux', - 'edit_item' => 'Éditer le niveau', - 'view_item' => 'Voir le niveau', - 'update_item' => 'Mettre à jour le niveau', - 'add_new_item' => 'Ajouter un niveau', - 'new_item_name' => 'Nouveau niveau', - 'search_items' => 'Rechercher parmi les niveaux', - 'popular_items' => 'Niveaux les plus utilisés' + 'name' => 'Flags', + 'singular_name' => 'Flag', + 'all_items' => 'Tous les flags', + 'edit_item' => 'Éditer le flag', + 'view_item' => 'Voir le flag', + 'update_item' => 'Mettre à jour le flag', + 'add_new_item' => 'Ajouter un flag', + 'new_item_name' => 'Nouveau flag', + 'search_items' => 'Rechercher parmi les flags', + 'popular_items' => 'Flags les plus utilisés' ), 'hierarchical' => false ) ); -register_taxonomy_for_object_type( 'niveau', 'post' ); +register_taxonomy_for_object_type( 'flag', 'post' ); + +// 1.2 - Ajout/Modif du niveau du flag +function flags_taxonomy_custom_fields($tag) { + // Check for existing taxonomy meta for the term you're editing + $t_id = $tag->term_id; // Get the ID of the term you're editing + $term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check +?> + + + + + + +
+ + + + +term_id; // Get the ID of the term you're editing + $term_meta = get_option( "taxonomy_term_$t_id" ); // Do the check +?> + +
+ + +

.

+
+ + + ID, 'flag'); + if ($flags) { + foreach( $flags as $flag ) { + $term_meta = get_option( "taxonomy_term_$flag->term_id" ); + echo "
"; + echo $flag->description; + echo "
"; + } + } ?> + +