From 915296f9be9a0d2eebbcc79269a519932e11e140 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Fri, 5 Jan 2024 08:30:26 +0800 Subject: [PATCH] Remove duplicate setting for getPostLinkProps and prefer stable naming (#57535) --- packages/block-library/src/block/edit.js | 3 +-- .../src/components/provider/use-block-editor-settings.js | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/block-library/src/block/edit.js b/packages/block-library/src/block/edit.js index 1892d614dba2a1..19d1f8196df509 100644 --- a/packages/block-library/src/block/edit.js +++ b/packages/block-library/src/block/edit.js @@ -183,8 +183,7 @@ export default function ReusableBlockEdit( { innerBlocks: blocks, userCanEdit: canEdit, getBlockEditingMode: editingMode, - getPostLinkProps: - getSettings().__experimentalGetPostLinkProps, + getPostLinkProps: getSettings().getPostLinkProps, }; }, [ patternClientId, ref ] diff --git a/packages/editor/src/components/provider/use-block-editor-settings.js b/packages/editor/src/components/provider/use-block-editor-settings.js index 9d60ef9cc6c487..e28ba9692dc289 100644 --- a/packages/editor/src/components/provider/use-block-editor-settings.js +++ b/packages/editor/src/components/provider/use-block-editor-settings.js @@ -50,6 +50,7 @@ const BLOCK_EDITOR_SETTINGS = [ 'fontSizes', 'gradients', 'generateAnchors', + 'getPostLinkProps', 'hasFixedToolbar', 'hasInlineToolbar', 'isDistractionFree', @@ -74,7 +75,6 @@ const BLOCK_EDITOR_SETTINGS = [ '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel', - '__experimentalGetPostLinkProps', ]; /** @@ -100,7 +100,6 @@ function useBlockEditorSettings( settings, postType, postId ) { userPatternCategories, restBlockPatterns, restBlockPatternCategories, - getPostLinkProps, } = useSelect( ( select ) => { const isWeb = Platform.OS === 'web'; @@ -113,8 +112,6 @@ function useBlockEditorSettings( settings, postType, postId ) { getBlockPatterns, getBlockPatternCategories, } = select( coreStore ); - const { getPostLinkProps: postLinkProps } = - select( editorStore ).getEditorSettings(); const { get } = select( preferencesStore ); const siteSettings = canUser( 'read', 'settings' ) @@ -145,7 +142,6 @@ function useBlockEditorSettings( settings, postType, postId ) { userPatternCategories: getUserPatternCategories(), restBlockPatterns: getBlockPatterns(), restBlockPatternCategories: getBlockPatternCategories(), - getPostLinkProps: postLinkProps, }; }, [ postType, postId ] @@ -257,7 +253,6 @@ function useBlockEditorSettings( settings, postType, postId ) { ? [ [ 'core/navigation', {}, [] ] ] : settings.template, __experimentalSetIsInserterOpened: setIsInserterOpened, - __experimentalGetPostLinkProps: getPostLinkProps, } ), [ allowRightClickOverrides, @@ -278,7 +273,6 @@ function useBlockEditorSettings( settings, postType, postId ) { pageForPosts, postType, setIsInserterOpened, - getPostLinkProps, ] ); }