Skip to content

Commit

Permalink
Refactor: simplify navigation title rendering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Jan 10, 2025
1 parent 77e23ec commit 9c254e4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/block-library/src/navigation/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 9c254e4

Please sign in to comment.