handling null value

This commit is contained in:
Antoine M 2023-11-28 16:25:18 +01:00
parent 52881f3ccd
commit 7e075648a5

View File

@ -5,11 +5,11 @@ $brochuresPosts = $args['brochuresPosts'];
<?php if ($brochuresPosts->have_posts()) : while ($brochuresPosts->have_posts()) : $brochuresPosts->the_post(); ?>
<?php
$brochurePdf = get_field('brochure_pdf', $args['ID']);
$brochureCover = get_field('brochure_cover_image', $brochurePdf['ID']);
$brochureEdition = get_field('brochure_edition', $args['ID']);
$thematique = get_the_terms($args['ID'], 'thematiques')[0];
$rootThematic = getParentThematique($thematique);
$brochurePdf = get_field('brochure_pdf', get_the_id()) ?? null;
$brochureCover = get_field('brochure_cover_image', $brochurePdf['ID']) ?? null;
$brochureEdition = get_field('brochure_edition', get_the_id()) ?? null;
$thematique = get_the_terms(get_the_id(), 'thematiques')[0] ?? null;
$rootThematic = getParentThematique($thematique) ?? null;
?>
<li class="publications-grid__row">