summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/home-link.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/blocks/home-link.php
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/blocks/home-link.php')
-rw-r--r--wp-includes/blocks/home-link.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/wp-includes/blocks/home-link.php b/wp-includes/blocks/home-link.php
index 8fb5ed1..9ec0c18 100644
--- a/wp-includes/blocks/home-link.php
+++ b/wp-includes/blocks/home-link.php
@@ -129,7 +129,10 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) {
*/
function render_block_core_home_link( $attributes, $content, $block ) {
if ( empty( $attributes['label'] ) ) {
- return '';
+ // Using a fallback for the label attribute allows rendering the block even if no attributes have been set,
+ // e.g. when using the block as a hooked block.
+ // Note that the fallback value needs to be kept in sync with the one set in `edit.js` (upon first loading the block in the editor).
+ $attributes['label'] = __( 'Home' );
}
$aria_current = '';