Skip to content

Commit

Permalink
Remove block name if custom name is available
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 25, 2024
1 parent b681b50 commit 7ed66b6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/block-editor/src/components/block-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
__experimentalVStack as VStack,
} from '@wordpress/components';
import { chevronLeft, chevronRight } from '@wordpress/icons';
import { __, isRTL, sprintf } from '@wordpress/i18n';
import { __, isRTL } from '@wordpress/i18n';
import { useSelect, useDispatch } from '@wordpress/data';

/**
Expand Down Expand Up @@ -66,14 +66,7 @@ function BlockCard( { title, icon, description, blockType, className, name } ) {
<BlockIcon icon={ icon } showColors />
<VStack spacing={ 1 }>
<h2 className="block-editor-block-card__title">
{ name?.length
? sprintf(
// translators: %1$s: Custom block name. %2$s: Block title.
__( '%1$s (%2$s)' ),
name,
title
)
: title }
{ name?.length ? name : title }
</h2>
{ description && (
<Text className="block-editor-block-card__description">
Expand Down

0 comments on commit 7ed66b6

Please sign in to comment.