";
$html .= "
";
$html .= "
". $status->description . "
";
@@ -95,6 +136,8 @@ function generate_home_posts_list() {
$html .= "
";
}
+ $html .= '
';
+
return $html;
}
@@ -102,63 +145,6 @@ add_shortcode('mesures', 'generate_home_posts_list');
-/**
- * Shortcode affichant le graphique de suivi des statuts
- */
-
-function generate_home_status_graph() {
-
- // Total des articles
- $total = wp_count_posts('post')->publish;
-
- // Ensuite, pour chaque catégorie donnée, on va :
- // récupérer le nombre de posts de cette cat
- // récupérer la couleur associée
- // calculer le pourcentage sur le total de mesures
- // créer un bloc html avec l data correspondante
-
- $stats = ["validated", "partially-validated", "discussed", "danger", "rejected", "undiscussed"];
- $obj_total = 0;
-
-
- $html = "";
-
- foreach ($stats as $stat) {
-
- $stat = get_term_by('slug', $stat, 'post-status');
- $color = get_field('couleur', "category_" . $stat->term_id);
- $percent = $stat->count * 100 / $total;
-
- $html .= "