diff --git a/backport-changelog/6.7/7676.md b/backport-changelog/6.7/7676.md new file mode 100644 index 00000000000000..19d9dc59048457 --- /dev/null +++ b/backport-changelog/6.7/7676.md @@ -0,0 +1,3 @@ +https://github.com/WordPress/wordpress-develop/pull/7676 + +* https://github.com/WordPress/gutenberg/pull/66359 diff --git a/lib/compat/wordpress-6.7/compat.php b/lib/compat/wordpress-6.7/compat.php index cd533a42cc528e..e58eca56ef71f9 100644 --- a/lib/compat/wordpress-6.7/compat.php +++ b/lib/compat/wordpress-6.7/compat.php @@ -40,7 +40,13 @@ function _gutenberg_add_block_templates_from_registry( $query_result, $query, $t } if ( ! isset( $query['wp_id'] ) ) { - $template_files = _gutenberg_get_block_templates_files( $template_type, $query ); + // We need to unset the post_type query param because some templates + // would be excluded otherwise, like `page.html` when looking for + // `page` templates. + // See: https://github.com/WordPress/gutenberg/issues/65584 + $template_files_query = $query; + unset( $template_files_query['post_type'] ); + $template_files = _gutenberg_get_block_templates_files( $template_type, $template_files_query ); /* * Add templates registered in the template registry. Filtering out the ones which have a theme file.