diff --git a/lib/experimental/posts/load.php b/lib/experimental/posts/load.php index 9be8d6945f19ff..c078fa6cda7af9 100644 --- a/lib/experimental/posts/load.php +++ b/lib/experimental/posts/load.php @@ -7,6 +7,14 @@ add_action( 'admin_menu', 'gutenberg_replace_posts_dashboard' ); +// Default to is-fullscreen-mode to avoid jumps in the UI. +add_filter( + 'admin_body_class', + static function ( $classes ) { + return "$classes is-fullscreen-mode"; + } +); + /** * Renders the new posts dashboard page. */ @@ -15,13 +23,13 @@ function gutenberg_posts_dashboard() { // $current_screen = get_current_screen(); // $current_screen->is_block_editor( true ); - // Default to is-fullscreen-mode to avoid jumps in the UI. - // add_filter( - // 'admin_body_class', - // static function ( $classes ) { - // return "$classes is-fullscreen-mode"; - // } - // ); + + + // $indexed_template_types = array(); + // foreach ( get_default_block_template_types() as $slug => $template_type ) { + // $template_type['slug'] = (string) $slug; + // $indexed_template_types[] = $template_type; + // } $block_editor_context = new WP_Block_Editor_Context( array( 'name' => 'core/edit-site' ) ); $custom_settings = array( diff --git a/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js b/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js index 0b3eb147527877..5c8cdfd58f6304 100644 --- a/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +++ b/packages/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js @@ -27,7 +27,7 @@ const postTypesWithoutParentTemplate = [ PATTERN_TYPES.user, ]; -const authorizedPostTypes = [ 'page' ]; +const authorizedPostTypes = [ 'page', 'post' ]; function useResolveEditedEntityAndContext( { postId, postType } ) { const { @@ -213,7 +213,8 @@ function useResolveEditedEntityAndContext( { postId, postType } ) { if ( postType && postId && authorizedPostTypes.includes( postType ) ) { return { postType, postId }; } - + // TODO: for post types lists we should probably not render the front page, but maybe a placeholder + // with a message like "Select a page" or something similar. if ( homepageId ) { return { postType: 'page', postId: homepageId }; }