Skip to content

Commit

Permalink
Fallback to site url in the site editor (#60885)
Browse files Browse the repository at this point in the history
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
  • Loading branch information
3 people authored Apr 19, 2024
1 parent 9496d61 commit 4158ed1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/edit-site/src/components/site-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
};
},
[]
Expand Down

1 comment on commit 4158ed1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 4158ed1.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8747903923
📝 Reported issues:

Please sign in to comment.