Skip to content

Commit

Permalink
Launch Checklist: Point Edit Homepage link to the Site Editor if site…
Browse files Browse the repository at this point in the history
… editor is enabled (#59323)
  • Loading branch information
jeyip authored Dec 16, 2021
1 parent ebe1b4f commit 12ed9e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/state/selectors/get-front-page-editor-url.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import getEditorUrl from 'calypso/state/selectors/get-editor-url';
import getSiteEditorUrl from 'calypso/state/selectors/get-site-editor-url';
import isSiteUsingCoreSiteEditor from 'calypso/state/selectors/is-site-using-core-site-editor.js';
import getSiteFrontPage from 'calypso/state/sites/selectors/get-site-front-page';

/**
Expand All @@ -14,5 +16,10 @@ export default function getFrontPageEditorUrl( state, siteId ) {
if ( 0 === frontPageId ) {
return false;
}

if ( isSiteUsingCoreSiteEditor( state, siteId ) ) {
return getSiteEditorUrl( state, siteId );
}

return getEditorUrl( state, siteId, frontPageId, 'page' );
}

0 comments on commit 12ed9e8

Please sign in to comment.