mirror of
git://develop.git.wordpress.org/
synced 2025-03-22 21:09:51 +01:00
Block Editor: Only list custom block templates in the template selector.
Previously all block templates including the hierarchy templates were being shown in the CPT template selector. Props mamaduka. See #54335. git-svn-id: https://develop.svn.wordpress.org/trunk@52334 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cc0ec8e72a
commit
3dada8377b
@ -1250,8 +1250,8 @@ final class WP_Theme implements ArrayAccess {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user