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; }