Skip to content

Commit

Permalink
Site Editor: Remove unused 'useSiteEditorSettings' hook (WordPress#64892
Browse files Browse the repository at this point in the history
)


Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: ramonjd <[email protected]>
  • Loading branch information
3 people authored and bph committed Aug 31, 2024
1 parent 15dea79 commit 0a3c48a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { useSelect } from '@wordpress/data';
import { useMemo } from '@wordpress/element';
import { privateApis as editorPrivateApis } from '@wordpress/editor';
import { privateApis as routerPrivateApis } from '@wordpress/router';
import { usePrevious } from '@wordpress/compose';

Expand All @@ -15,7 +14,6 @@ import { unlock } from '../../lock-unlock';
import useNavigateToEntityRecord from './use-navigate-to-entity-record';
import { FOCUSABLE_ENTITIES } from '../../utils/constants';

const { useBlockEditorSettings } = unlock( editorPrivateApis );
const { useLocation, useHistory } = unlock( routerPrivateApis );

function useNavigateToPreviousEntityRecord() {
Expand Down Expand Up @@ -83,19 +81,3 @@ export function useSpecificEditorSettings() {

return defaultEditorSettings;
}

export default function useSiteEditorSettings() {
const defaultEditorSettings = useSpecificEditorSettings();
const { postType, postId } = useSelect( ( select ) => {
const { getEditedPostType, getEditedPostId } = unlock(
select( editSiteStore )
);
const usedPostType = getEditedPostType();
const usedPostId = getEditedPostId();
return {
postType: usedPostType,
postId: usedPostId,
};
}, [] );
return useBlockEditorSettings( defaultEditorSettings, postType, postId );
}
2 changes: 0 additions & 2 deletions packages/editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import * as interfaceApis from '@wordpress/interface';
import { lock } from './lock-unlock';
import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
import EditorContentSlotFill from './components/editor-interface/content-slot-fill';
import useBlockEditorSettings from './components/provider/use-block-editor-settings';
import BackButton from './components/header/back-button';
import CreateTemplatePartModal from './components/create-template-part-modal';
import Editor from './components/editor';
Expand Down Expand Up @@ -51,7 +50,6 @@ lock( privateApis, {
bootstrapBlockBindingsSourcesFromServer,

// This is a temporary private API while we're updating the site editor to use EditorProvider.
useBlockEditorSettings,
interfaceStore,
...remainingInterfaceApis,
} );

0 comments on commit 0a3c48a

Please sign in to comment.