From 36dc97b5ee8e49f1f7294d62dbdcb3568cf974e9 Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 19 Apr 2024 11:34:29 +1000 Subject: [PATCH] Fallback to site url in the site editor --- 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, }; }, []