From 46f15fa1f97e54dd721a7883ccedf4c9d478834d Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:33:57 +1200 Subject: [PATCH] Add tag name configurability to global footer block --- mu-plugins/blocks/global-header-footer/blocks.php | 4 +++- .../blocks/global-header-footer/src/footer/block.json | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mu-plugins/blocks/global-header-footer/blocks.php b/mu-plugins/blocks/global-header-footer/blocks.php index 77741954d..ca048162e 100644 --- a/mu-plugins/blocks/global-header-footer/blocks.php +++ b/mu-plugins/blocks/global-header-footer/blocks.php @@ -847,8 +847,10 @@ function render_global_footer( $attributes, $content, $block ) { $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'global-footer wp-block-group' ) ); + $tag_name = $attributes['tagName'] ?? 'footer'; return sprintf( - '%3$s', + '<%1$s %2$s>%3$s%4$s', + $tag_name, $wrapper_attributes, $markup, $footer_markup, diff --git a/mu-plugins/blocks/global-header-footer/src/footer/block.json b/mu-plugins/blocks/global-header-footer/src/footer/block.json index 8a11a6925..07408dc95 100644 --- a/mu-plugins/blocks/global-header-footer/src/footer/block.json +++ b/mu-plugins/blocks/global-header-footer/src/footer/block.json @@ -26,7 +26,12 @@ "width": true } }, - "attributes": {}, + "attributes": { + "tagName": { + "type": "string", + "default": "footer" + } + }, "textdomain": "wporg", "style": "wporg-global-header-footer", "editorStyle": "wporg-global-header-footer",