From 4158ed14438f4f2473986db2a1743911b1040f5f Mon Sep 17 00:00:00 2001 From: Ramon Date: Fri, 19 Apr 2024 13:17:24 +1000 Subject: [PATCH] Fallback to site url in the site editor (#60885) Co-authored-by: ramonjd Co-authored-by: t-hamano --- packages/edit-site/src/components/site-hub/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/site-hub/index.js b/packages/edit-site/src/components/site-hub/index.js index cc1ce651082c8..8fa310b65aa9c 100644 --- a/packages/edit-site/src/components/site-hub/index.js +++ b/packages/edit-site/src/components/site-hub/index.js @@ -23,6 +23,7 @@ import { memo } from '@wordpress/element'; import { search, external } from '@wordpress/icons'; import { store as commandsStore } from '@wordpress/commands'; import { displayShortcut } from '@wordpress/keycodes'; +import { filterURLForDisplay } from '@wordpress/url'; /** * Internal dependencies @@ -44,13 +45,16 @@ const SiteHub = memo( ( { isTransparent, className } ) => { getSite, getUnstableBase, // Site index. } = select( coreStore ); - + const _site = getSite(); return { canvasMode: getCanvasMode(), dashboardLink: getSettings().__experimentalDashboardLink || 'index.php', homeUrl: getUnstableBase()?.home, - siteTitle: getSite()?.title, + siteTitle: + ! _site?.title && !! _site?.url + ? filterURLForDisplay( _site?.url ) + : _site?.title, }; }, []