diff --git a/functions.php b/functions.php index 0f942fc..fc2e64c 100644 --- a/functions.php +++ b/functions.php @@ -102,3 +102,43 @@ function mypost_social_sharing_buttons($content) { } }; add_filter( 'the_content', 'mypost_social_sharing_buttons'); + +add_action( 'post_tag_add_form_fields', 'kspace_add_term_fields' ); + +function kspace_add_term_fields( $taxonomy ) { + echo '
+ + +

Une URL permettant d\'obtenir plus d\'information sur le tag.

+
'; +} + +add_action( 'post_tag_edit_form_fields', 'misha_edit_term_fields', 10, 2 ); + +function misha_edit_term_fields( $term, $taxonomy ) { + + $value = get_term_meta( $term->term_id, 'plus-dinfo', true ); + + echo ' + + + + + +

Une URL permettant d\'obtenir plus d\'information sur le tag.

+ + '; +} + +add_action( 'created_post_tag', 'misha_save_term_fields' ); +add_action( 'edited_post_tag', 'misha_save_term_fields' ); + +function misha_save_term_fields( $term_id ) { + + update_term_meta( + $term_id, + 'plus-dinfo', + sanitize_text_field( $_POST[ 'plus-dinfo' ] ) + ); + +} diff --git a/tag.php b/tag.php index 104488c..573708c 100644 --- a/tag.php +++ b/tag.php @@ -10,8 +10,13 @@
-

Tout les éléments enregistré pour le tag

+

Flux RSS du tag'; ?>

+ Plus d\'info

'; + } + ?>