From 67c1b1c2ab69cb6e5bd1fec3782353f1ca007921 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 10 May 2022 11:26:09 +0400 Subject: [PATCH] Site Editor: Decode entities in the site title (#40956) * Site Editor: Decode entities in the site title * Decode title argument --- packages/edit-site/src/components/routes/use-title.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/routes/use-title.js b/packages/edit-site/src/components/routes/use-title.js index 23ebaf31006e73..1ff7a52e25357d 100644 --- a/packages/edit-site/src/components/routes/use-title.js +++ b/packages/edit-site/src/components/routes/use-title.js @@ -6,6 +6,7 @@ import { useSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; import { __, sprintf } from '@wordpress/i18n'; import { speak } from '@wordpress/a11y'; +import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies @@ -36,8 +37,8 @@ export default function useTitle( title ) { const formattedTitle = sprintf( /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */ __( '%1$s ‹ %2$s — WordPress' ), - title, - siteTitle + decodeEntities( title ), + decodeEntities( siteTitle ) ); document.title = formattedTitle;