-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identify the site frontpage in link UI search results #36493
Changes from all commits
33c5293
537b8b3
4f7845a
b2c19c3
e0a90bc
50b8c0b
9f7c6da
6bb4e6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,18 @@ function useBlockEditorSettings( settings, hasTemplate ) { | |
hasUploadPermissions, | ||
canUseUnfilteredHTML, | ||
userCanCreatePages, | ||
pageOnFront, | ||
} = useSelect( ( select ) => { | ||
const { canUserUseUnfilteredHTML } = select( editorStore ); | ||
const isWeb = Platform.OS === 'web'; | ||
const { canUser, getUnstableBase, hasFinishedResolution } = select( | ||
coreStore | ||
); | ||
const { | ||
canUser, | ||
getUnstableBase, | ||
hasFinishedResolution, | ||
getEntityRecord, | ||
} = select( coreStore ); | ||
|
||
const siteSettings = getEntityRecord( 'root', 'site' ); | ||
|
||
const siteData = getUnstableBase(); | ||
|
||
|
@@ -64,6 +70,7 @@ function useBlockEditorSettings( settings, hasTemplate ) { | |
hasResolvedLocalSiteData: hasFinishedResolvingSiteData, | ||
baseUrl: siteData?.url || '', | ||
userCanCreatePages: canUser( 'create', 'pages' ), | ||
pageOnFront: siteSettings?.page_on_front, | ||
}; | ||
}, [] ); | ||
|
||
|
@@ -139,6 +146,7 @@ function useBlockEditorSettings( settings, hasTemplate ) { | |
outlineMode: hasTemplate, | ||
__experimentalCreatePageEntity: createPageEntity, | ||
__experimentalUserCanCreatePages: userCanCreatePages, | ||
pageOnFront, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adamziel Would you mind confidence checking me here? A previous PR I created introduced a typing performance degradation because the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the first sight it seems safe – I don't suppose pageOnFront will change that often. What's your previous PR? I'd like to compare the two. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one (owch!) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I commented with my assessment there. |
||
} ), | ||
[ | ||
settings, | ||
|
@@ -148,6 +156,7 @@ function useBlockEditorSettings( settings, hasTemplate ) { | |
undo, | ||
hasTemplate, | ||
userCanCreatePages, | ||
pageOnFront, | ||
] | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javierarce I updated it