From 9c254e48a960010c8956b042951b7a1c4c569680 Mon Sep 17 00:00:00 2001 From: yogeshbhutkar Date: Fri, 10 Jan 2025 17:53:29 +0530 Subject: [PATCH] Refactor: simplify navigation title rendering logic --- packages/block-library/src/navigation/index.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/block-library/src/navigation/index.js b/packages/block-library/src/navigation/index.js index 87f2f4bd15785..e19efaf78d156 100644 --- a/packages/block-library/src/navigation/index.js +++ b/packages/block-library/src/navigation/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { navigation as icon } from '@wordpress/icons'; import { select } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; @@ -66,16 +66,11 @@ export const settings = { ref ); - if ( ! navigation?.title || navigation.title === metadata.title ) { + if ( ! navigation?.title ) { return; } - return sprintf( - // translators: %1$s: block title, %2$s: navigation title. - __( '%1$s (%2$s)' ), - metadata.title, - decodeEntities( navigation.title ) - ); + return decodeEntities( navigation.title ); }, deprecated, };