Skip to content

Commit 60adbba

Browse files
committed
Fix initialisation of post id and post type
1 parent d077c2c commit 60adbba

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/edit-post/src/editor.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,19 @@ import { unlock } from './lock-unlock';
2626
import useInitEditedEntityFromURL from './components/sync-state-with-url/use-init-edited-entity-from-url';
2727
const { ExperimentalEditorProvider } = unlock( editorPrivateApis );
2828

29-
function Editor( { settings, initialEdits, ...props } ) {
29+
function Editor( {
30+
postId: postIdInit,
31+
postType: postTypeInit,
32+
settings,
33+
initialEdits,
34+
...props
35+
} ) {
3036
const isLargeViewport = useViewportMatch( 'medium' );
31-
const { postId, postType = 'post' } = useInitEditedEntityFromURL();
37+
const { postId: postIdUrl, postType: postTypeUrl } =
38+
useInitEditedEntityFromURL();
3239

40+
const postId = postIdUrl || postIdInit;
41+
const postType = postTypeUrl || postTypeInit;
3342
const {
3443
allowRightClickOverrides,
3544
hasFixedToolbar,

0 commit comments

Comments
 (0)