diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-19 12:16:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-19 12:16:56 +0000 |
commit | 8a58fd166251eccbb629f18b0873caed32673115 (patch) | |
tree | 357d2ca62286e1c369d6fea2b51f3385b8e20d6b /wp-includes/js/dist/edit-site.js | |
parent | Releasing progress-linux version 6.5.2+dfsg1-1~progress7.99u1. (diff) | |
download | wordpress-8a58fd166251eccbb629f18b0873caed32673115.tar.xz wordpress-8a58fd166251eccbb629f18b0873caed32673115.zip |
Merging upstream version 6.5.3+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/js/dist/edit-site.js')
-rw-r--r-- | wp-includes/js/dist/edit-site.js | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/wp-includes/js/dist/edit-site.js b/wp-includes/js/dist/edit-site.js index df841da..c29d3d9 100644 --- a/wp-includes/js/dist/edit-site.js +++ b/wp-includes/js/dist/edit-site.js @@ -17919,6 +17919,7 @@ function useResolveEditedEntityAndContext({ const { hasLoadedAllDependencies, homepageId, + postsPageId, url, frontPageTemplateId } = (0,external_wp_data_namespaceObject.useSelect)(select => { @@ -17932,16 +17933,20 @@ function useResolveEditedEntityAndContext({ const templates = getEntityRecords('postType', constants_TEMPLATE_POST_TYPE, { per_page: -1 }); - let _frontPateTemplateId; + const _homepageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_on_front) && !!+siteData.page_on_front // We also need to check if it's not zero(`0`). + ? siteData.page_on_front.toString() : null; + const _postsPageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_for_posts) ? siteData.page_for_posts.toString() : null; + let _frontPageTemplateId; if (templates) { const frontPageTemplate = templates.find(t => t.slug === 'front-page'); - _frontPateTemplateId = frontPageTemplate ? frontPageTemplate.id : false; + _frontPageTemplateId = frontPageTemplate ? frontPageTemplate.id : false; } return { hasLoadedAllDependencies: !!base && !!siteData, - homepageId: siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_on_front) ? siteData.page_on_front.toString() : null, + homepageId: _homepageId, + postsPageId: _postsPageId, url: base?.home, - frontPageTemplateId: _frontPateTemplateId + frontPageTemplateId: _frontPageTemplateId }; }, []); @@ -17979,6 +17984,10 @@ function useResolveEditedEntityAndContext({ if (!editedEntity) { return undefined; } + // Check if the current page is the posts page. + if (postTypeToResolve === 'page' && postsPageId === postIdToResolve) { + return __experimentalGetTemplateForLink(editedEntity.link)?.id; + } // First see if the post/page has an assigned template and fetch it. const currentTemplateSlug = editedEntity.template; if (currentTemplateSlug) { @@ -18030,7 +18039,7 @@ function useResolveEditedEntityAndContext({ const template = __experimentalGetTemplateForLink(url); return template?.id; } - }, [homepageId, hasLoadedAllDependencies, url, postId, postType, path, frontPageTemplateId]); + }, [homepageId, postsPageId, hasLoadedAllDependencies, url, postId, postType, path, frontPageTemplateId]); const context = (0,external_wp_element_namespaceObject.useMemo)(() => { if (postTypesWithoutParentTemplate.includes(postType)) { return {}; @@ -27730,9 +27739,7 @@ function InstalledFonts() { onClick: () => { handleSetLibraryFontSelected(font); } - }))), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, { - margin: 16 - })), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { + })))), (0,external_React_.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorScreen, { path: "/fontFamily" }, (0,external_React_.createElement)(ConfirmDeleteDialog, { font: libraryFontSelected, |