From aae1e112ddfb63b5014281adebdad3c8ee36bfc2 Mon Sep 17 00:00:00 2001 From: asus Date: Sat, 11 Nov 2023 13:56:24 +0100 Subject: [PATCH] created zip for fabien --- README.md | 16 ++-- plug/map_prof/srcs/menu/mp_menu_content.php | 83 +++++++++++++++--- ...map_prof.zip => map_prof_good_version.zip} | Bin 47542 -> 47824 bytes 3 files changed, 79 insertions(+), 20 deletions(-) rename plug/{map_prof.zip => map_prof_good_version.zip} (86%) diff --git a/README.md b/README.md index 4a78255..c2b9c26 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,14 @@ ## 1.2. todo -- [ ] create wp plugin menu -- [ ] add infos in menu - - [ ] gmaps api key - - [ ] missing addresses -- [ ] -- [ ] -- [ ] -- [ ] +- [/] create wp plugin menu +- [/] add infos in menu + - [/] gmaps api key + - [/] missing addresses +- [/] error strlen +- [/] add counter +- [/] menu select published posts +- [/] menu show error format in categories ## 1.3. temps de travail diff --git a/plug/map_prof/srcs/menu/mp_menu_content.php b/plug/map_prof/srcs/menu/mp_menu_content.php index a6e1608..20b5e0c 100644 --- a/plug/map_prof/srcs/menu/mp_menu_content.php +++ b/plug/map_prof/srcs/menu/mp_menu_content.php @@ -72,17 +72,30 @@ function mp_bad_categories($posts_list) { +function count_publish($arr_posts) { + return($arr_posts->post_status === "publish"); +} + + + + function mp_show_list_posts_no_address($posts) { + $all_posts = count($posts); + $published_posts = count(array_filter($posts, "count_publish")); + echo <<

ATTENTION !

+ +

HTML; - echo count($posts); + echo "$all_posts"; + echo "$published_posts"; echo ''; if (count($posts) == 1) echo " article n'a pas d'adresse :"; @@ -93,9 +106,16 @@ function mp_show_list_posts_no_address($posts) {