From e090dbaee72d991256c54c678ff534364412de12 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 20 Nov 2024 12:51:05 +0400 Subject: [PATCH] Cleanup --- packages/block-library/src/home-link/edit.js | 52 +++++++++---------- .../block-library/src/home-link/index.php | 3 -- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/packages/block-library/src/home-link/edit.js b/packages/block-library/src/home-link/edit.js index 9234c4e4d976a..793e13515411d 100644 --- a/packages/block-library/src/home-link/edit.js +++ b/packages/block-library/src/home-link/edit.js @@ -35,32 +35,30 @@ export default function HomeEdit( { attributes, setAttributes, context } ) { } ); return ( - <> -
- - { - setAttributes( { label: labelValue } ); - } } - aria-label={ __( 'Home link text' ) } - placeholder={ __( 'Add home link' ) } - withoutInteractiveFormatting - allowedFormats={ [ - 'core/bold', - 'core/italic', - 'core/image', - 'core/strikethrough', - ] } - /> - -
- +
+ + { + setAttributes( { label: labelValue } ); + } } + aria-label={ __( 'Home link text' ) } + placeholder={ __( 'Add home link' ) } + withoutInteractiveFormatting + allowedFormats={ [ + 'core/bold', + 'core/italic', + 'core/image', + 'core/strikethrough', + ] } + /> + +
); } diff --git a/packages/block-library/src/home-link/index.php b/packages/block-library/src/home-link/index.php index fb7235834459d..d61aa0bc235e2 100644 --- a/packages/block-library/src/home-link/index.php +++ b/packages/block-library/src/home-link/index.php @@ -137,9 +137,6 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) { */ function render_block_core_home_link( $attributes, $content, $block ) { if ( empty( $attributes['label'] ) ) { - // 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 = '';