diff --git a/functions.php b/functions.php index 69ad13f..d281821 100644 --- a/functions.php +++ b/functions.php @@ -1,22 +1,30 @@ '
', - 'after_widget' => '
', - 'before_title' => '

', - 'after_title' => '

', - )); + function kspace_post_supports() { + add_post_type_support( 'post', 'excerpt'); + } -/* 2. Niveau support (for featured posts) */ + add_action( 'init', 'kspace_post_supports' ); + + add_theme_support( 'post-thumbnails' ); + set_post_thumbnail_size( 825, 510, true ); + +/* 1. Niveau support + * + * Permet d'afficher les niveaux de post pour les post features + */ register_taxonomy( 'niveau', @@ -41,18 +49,11 @@ register_taxonomy( register_taxonomy_for_object_type( 'niveau', 'post' ); -/* 3. Excerpt and thumbnail support */ - -function wpqdouze_post_supports() { - add_post_type_support( 'post', 'excerpt'); -} - -add_action( 'init', 'wpqdouze_post_supports' ); - -add_theme_support( 'post-thumbnails' ); -set_post_thumbnail_size( 825, 510, true ); - -/* 4. Social Network */ +/* 2. Réseaux sociaux + * + * Permet d'afficher les réseaux sociaux en bas du post. + * + */ function mypost_social_sharing_buttons($content) { // Fork of mypost_social_sharing_buttons @@ -103,25 +104,32 @@ function mypost_social_sharing_buttons($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', 'misha_edit_term_fields', 10, 2 ); +add_action( 'post_tag_edit_form_fields', 'kspace_edit_term_fields', 10, 2 ); -function misha_edit_term_fields( $term, $taxonomy ) { +function kspace_edit_term_fields( $term, $taxonomy ) { $value = get_term_meta( $term->term_id, 'plus-dinfo', true ); echo ' - + @@ -130,10 +138,10 @@ function misha_edit_term_fields( $term, $taxonomy ) { '; } -add_action( 'created_post_tag', 'misha_save_term_fields' ); -add_action( 'edited_post_tag', 'misha_save_term_fields' ); +add_action( 'created_post_tag', 'kspace_save_term_fields' ); +add_action( 'edited_post_tag', 'kspace_save_term_fields' ); -function misha_save_term_fields( $term_id ) { +function kspace_save_term_fields( $term_id ) { update_term_meta( $term_id, @@ -143,22 +151,24 @@ function misha_save_term_fields( $term_id ) { } -// --------------------------------------------- -// Ajout des champs custom pour l'utilisateur -// --------------------------------------------- +/* 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' ); -add_action( 'show_user_profile', 'crf_show_extra_profile_fields' ); -add_action( 'edit_user_profile', 'crf_show_extra_profile_fields' ); - -function crf_show_extra_profile_fields( $user ) { +function kspace_show_extra_profile_fields( $user ) { $year = get_the_author_meta( 'infodata', $user->ID ); ?> -

+

- +