From 33aff070604cc137dddf3a197febfdca900e6996 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Thu, 30 Nov 2023 22:05:09 +0100 Subject: [PATCH] fixing renaming problem --- includes/post-brochures.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/post-brochures.php b/includes/post-brochures.php index 7f0ee91..1293b0f 100644 --- a/includes/post-brochures.php +++ b/includes/post-brochures.php @@ -3,16 +3,18 @@ function homegrade_brochure_post_title_updater($post_id) { + + $my_post = array(); $my_post['ID'] = $post_id; - if (!$post_id) return - $brochureTaxonomy = get_the_terms($post_id, 'thematiques')[0]; + $fields = get_fields($post_id); + $brochureTaxonomy = $fields['publications_taxonomy']; + + if (!$post_id) return; - // write_log($brochureTaxonomy); if (get_post_type() == 'brochures') { - $my_post['post_title'] = ""; $my_post['post_title'] = $brochureTaxonomy->name; }