Skip to content

Commit

Permalink
Only unset post_type from the query
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed Oct 29, 2024
1 parent f957f64 commit 1641d59
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/compat/wordpress-6.7/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
// 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.
Expand Down

0 comments on commit 1641d59

Please sign in to comment.