From 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:57:26 +0200 Subject: Adding upstream version 6.5+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/blocks/home-link.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'wp-includes/blocks/home-link.php') 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 = ''; -- cgit v1.2.3