//Initialisation add_action('add_meta_boxes','mes_metaboxes'); function mes_metaboxes(){ add_meta_box('things', 'choses à faire', 'things_to_do', 'post', 'normal', 'default'); } //fonction alternative à get_post_meta function get_post_meta_ordered($id,$meta_key){ global $wpdb; $output = array(); $sql = "SELECT m.meta_value FROM ".$wpdb->postmeta." m where m.meta_key = '".$meta_key."' and m.post_id = '".$id."' order by m.meta_id"; $results = $wpdb->get_results( $sql ); foreach( $results as $result ){ $output[] = $result->meta_value; } return array_filter($output); } // Fonction de construction de la metabox function things_to_do($post){ global $wpdb; //taches $to_do = get_post_meta_ordered($post->ID,'_descr_chose'); //duree $duree_chose = get_post_meta_ordered($post->ID,'_duree_chose'); // nonce wp_nonce_field( 'update-taches_'.$post->ID, '_wpnonce_update_taches' ); //boucle echo '