From 7c5a40158061bf1949a8736a647e53e02715d413 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 2 Oct 2024 09:51:50 +0200 Subject: [PATCH] fixing postDescripption ternary when unefined value --- blocks/post-card/build/render.php | 2 +- blocks/post-card/src/render.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/post-card/build/render.php b/blocks/post-card/build/render.php index 33be0a0..77fdf6a 100644 --- a/blocks/post-card/build/render.php +++ b/blocks/post-card/build/render.php @@ -12,7 +12,7 @@ $mainThematique = getMainThematique($thematique); $thematiqueColorSlug = $mainThematique->slug; $thematique_icon = get_field('taxonomy_pictures', 'thematiques' . '_' . $mainThematique->term_id)['icon']; -$postDescription = $attributes['postDescription']; +$postDescription = $attributes['postDescription'] ?? null; $coverUrl = $postType->name === 'videos-webinaires' && $postThumbnail ? $postThumbnail : ($thematique_icon ? $thematique_icon['url'] : null); diff --git a/blocks/post-card/src/render.php b/blocks/post-card/src/render.php index 33be0a0..77fdf6a 100644 --- a/blocks/post-card/src/render.php +++ b/blocks/post-card/src/render.php @@ -12,7 +12,7 @@ $mainThematique = getMainThematique($thematique); $thematiqueColorSlug = $mainThematique->slug; $thematique_icon = get_field('taxonomy_pictures', 'thematiques' . '_' . $mainThematique->term_id)['icon']; -$postDescription = $attributes['postDescription']; +$postDescription = $attributes['postDescription'] ?? null; $coverUrl = $postType->name === 'videos-webinaires' && $postThumbnail ? $postThumbnail : ($thematique_icon ? $thematique_icon['url'] : null);