Skip to content

Commit

Permalink
Add tag name configurability to global footer block
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwoodnz committed Jun 5, 2024
1 parent 4be8166 commit 46f15fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mu-plugins/blocks/global-header-footer/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<footer %1$s>%2$s</footer>%3$s',
'<%1$s %2$s>%3$s</%1$s>%4$s',
$tag_name,
$wrapper_attributes,
$markup,
$footer_markup,
Expand Down
7 changes: 6 additions & 1 deletion mu-plugins/blocks/global-header-footer/src/footer/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 46f15fa

Please sign in to comment.