diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index b5ac408278fac..2f9e60b35cd12 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -1250,8 +1250,8 @@ public function get_post_templates() { } if ( current_theme_supports( 'block-templates' ) ) { - $block_templates = get_block_templates( array(), 'wp_template' ); foreach ( get_post_types( array( 'public' => true ) ) as $type ) { + $block_templates = get_block_templates( array( 'post_type' => $type ), 'wp_template' ); foreach ( $block_templates as $block_template ) { $post_templates[ $type ][ $block_template->slug ] = $block_template->title; }