handling conditionnal anchors to avoid bugs

This commit is contained in:
Antoine M 2023-11-29 18:53:55 +01:00
parent 66c950530b
commit 8d617f1fd4
3 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,11 +9,11 @@ $customImageUrl = $attributes['imageUrl'] ?? null;
$customImageAlt = $attributes['imageAlt'] ?? null; $customImageAlt = $attributes['imageAlt'] ?? null;
$customTitle = $attributes['blockCustomTitle'] ?? null; $customTitle = $attributes['blockCustomTitle'] ?? null;
$anchor = esc_html($attributes['anchor'])
?> ?>
<section id="<?php echo esc_html($attributes['anchor']) ?>" <?php echo get_block_wrapper_attributes(['class' => 'block-content-page-header']) ?>> <section id="<?php echo $anchor ?? "" ?>" <?php echo get_block_wrapper_attributes(['class' => 'block-content-page-header']) ?>>
<div class="block-content-page-header__content"> <div class="block-content-page-header__content">
<div className="section_titling"> <div className="section_titling">
<?php if (!$attributes['hasCustomTitle']) : ?> <?php if (!$attributes['hasCustomTitle']) : ?>

View File

@ -9,11 +9,11 @@ $customImageUrl = $attributes['imageUrl'] ?? null;
$customImageAlt = $attributes['imageAlt'] ?? null; $customImageAlt = $attributes['imageAlt'] ?? null;
$customTitle = $attributes['blockCustomTitle'] ?? null; $customTitle = $attributes['blockCustomTitle'] ?? null;
$anchor = esc_html($attributes['anchor'])
?> ?>
<section id="<?php echo esc_html($attributes['anchor']) ?>" <?php echo get_block_wrapper_attributes(['class' => 'block-content-page-header']) ?>> <section id="<?php echo $anchor ?? "" ?>" <?php echo get_block_wrapper_attributes(['class' => 'block-content-page-header']) ?>>
<div class="block-content-page-header__content"> <div class="block-content-page-header__content">
<div className="section_titling"> <div className="section_titling">
<?php if (!$attributes['hasCustomTitle']) : ?> <?php if (!$attributes['hasCustomTitle']) : ?>