fixing renaming problem

This commit is contained in:
Antoine M 2023-11-30 22:05:09 +01:00
parent b0d79dc9c5
commit 33aff07060

View File

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