From 65c264bcb935433a1a4579d7f428decbd903dd68 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Tue, 30 Jul 2024 21:56:49 +0530 Subject: [PATCH 1/2] check if active theme is block theme --- lib/compat/wordpress-6.7/post.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compat/wordpress-6.7/post.php b/lib/compat/wordpress-6.7/post.php index 7175fa9664006..d89dc7b458a98 100644 --- a/lib/compat/wordpress-6.7/post.php +++ b/lib/compat/wordpress-6.7/post.php @@ -38,6 +38,7 @@ function gutenberg_post_type_default_rendering_mode( $args, $post_type ) { // Make sure the post type supports the block editor. if ( + wp_is_block_theme() && ( isset( $args['show_in_rest'] ) && $args['show_in_rest'] ) && ( isset( $args['supports'] ) && in_array( 'editor', $args['supports'], true ) ) ) { From a27c07e680f1966860c31727f47dc12d747dfff3 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Wed, 31 Jul 2024 00:02:32 +0530 Subject: [PATCH 2/2] fix broken test --- test/e2e/specs/site-editor/command-center.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/e2e/specs/site-editor/command-center.spec.js b/test/e2e/specs/site-editor/command-center.spec.js index fce951ca767be..ebda424a86c54 100644 --- a/test/e2e/specs/site-editor/command-center.spec.js +++ b/test/e2e/specs/site-editor/command-center.spec.js @@ -30,6 +30,17 @@ test.describe( 'Site editor command palette', () => { await expect( page ).toHaveURL( '/wp-admin/post-new.php?post_type=page' ); + await page.evaluate( () => { + window.wp.data + .dispatch( 'core/preferences' ) + .set( 'core/edit-post', 'welcomeGuide', false ); + }, false ); + await page.getByLabel( 'Template options' ).click(); + + await page + .getByRole( 'menuitemcheckbox', { name: 'Show template' } ) + .click(); + await expect( editor.canvas.getByRole( 'textbox', { name: 'Add title' } ) ).toBeVisible();