'Flag', 'labels' => array( '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( '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 ), 'full' ); // Construct sharing URL without using any script $twitterURL = 'https://twitter.com/intent/tweet?text='.$mypost_Title.'&url='.$mypost_URL.'&via=mypost_'; $facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$mypost_URL; $bufferURL = 'https://bufferapp.com/add?url='.$mypost_URL.'&text='.$mypost_Title; $whatsappURL = 'whatsapp://send?text='.$mypost_Title . ' ' . $mypost_URL; $linkedInURL = 'https://www.linkedin.com/shareArticle?mini=true&url='.$mypost_URL.'&title='.$mypost_Title; $diasporaURL = 'http://sharetodiaspora.github.io/?title=' . $mypost_Title . '&url=' . $mypost_URL; // Based on popular demand added Pinterest too $pinterestURL = 'https://pinterest.com/pin/create/button/?url='.$mypost_URL.'&media='.$mypost_Thumbnail[0].'&description='.$mypost_Title; // Add sharing button at the end of page/page content $content .= ''; $content .= '
'; $content .= ' '; $content .= ' '; $content .= ''; $content .= '
'; return $content; }else{ // if not a post/page then don't include sharing button return $content; } }; add_filter( 'the_content', 'mypost_social_sharing_buttons'); /* 3. Plus d'info sur les tags * * Permet d'afficher un lien vers plus d'informations. * Le liens est gardé comme un champ supplémentaire dans les tags. * */ 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', 'kspace_edit_term_fields', 10, 2 ); function kspace_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', 'kspace_save_term_fields' ); add_action( 'edited_post_tag', 'kspace_save_term_fields' ); function kspace_save_term_fields( $term_id ) { update_term_meta( $term_id, 'plus-dinfo', sanitize_text_field( $_POST[ 'plus-dinfo' ] ) ); } /* 3. Info supplémentaire sur profil utilisateur * * Permet d'afficher sous forme de chaine de caractères des infos supplémentaires qui seront * transformé en un tableau.. * */ add_action( 'show_user_profile', 'kspace_show_extra_profile_fields' ); add_action( 'edit_user_profile', 'kspace_show_extra_profile_fields' ); function kspace_show_extra_profile_fields( $user ) { $year = get_the_author_meta( 'infodata', $user->ID ); ?>

'Roman', 'labels' => array( 'name' => 'Romans', 'singular_name' => 'Roman', 'all_items' => 'Tous les romans', 'edit_item' => 'Éditer le roman', 'view_item' => 'Voir le roman', 'update_item' => 'Mettre à jour le roman', 'add_new_item' => 'Ajouter un roman', 'new_item_name' => 'Nouveau roman', 'search_items' => 'Rechercher parmi les romans', 'popular_items' => 'Romans les plus utilisés'), 'rewrite' => array('slug' => 'roman'), 'hierarchical' => false, 'public' => true, 'hierarchical' => true, 'show_in_nav_menus' => true, 'has_archive' => true, ) ); register_taxonomy_for_object_type( 'roman', 'post' ); // 1.2 - Ajout/Modif du niveau du flag function romans_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 ?>

.