From 0063545bbcac7ea506fc5f85638d1c57b87092da Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 29 Nov 2023 18:57:16 +0100 Subject: [PATCH] handling conditionnal anchors to avoid bugs --- blocks/content-page-header/build/render.php | 2 +- blocks/content-page-header/src/render.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blocks/content-page-header/build/render.php b/blocks/content-page-header/build/render.php index 9a84089..2c995e9 100644 --- a/blocks/content-page-header/build/render.php +++ b/blocks/content-page-header/build/render.php @@ -9,7 +9,7 @@ $customImageUrl = $attributes['imageUrl'] ?? null; $customImageAlt = $attributes['imageAlt'] ?? null; $customTitle = $attributes['blockCustomTitle'] ?? null; -$anchor = esc_html($attributes['anchor']) +$anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : null; ?> diff --git a/blocks/content-page-header/src/render.php b/blocks/content-page-header/src/render.php index 9a84089..2c995e9 100644 --- a/blocks/content-page-header/src/render.php +++ b/blocks/content-page-header/src/render.php @@ -9,7 +9,7 @@ $customImageUrl = $attributes['imageUrl'] ?? null; $customImageAlt = $attributes['imageAlt'] ?? null; $customTitle = $attributes['blockCustomTitle'] ?? null; -$anchor = esc_html($attributes['anchor']) +$anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : null; ?>