Make WordPress Core

Changeset 52334


Ignore:
Timestamp:
12/07/2021 04:31:59 PM (3 years ago)
Author:
youknowriad
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme.php

    r52330 r52334  
    12511251
    12521252            if ( current_theme_supports( 'block-templates' ) ) {
    1253                 $block_templates = get_block_templates( array(), 'wp_template' );
    12541253                foreach ( get_post_types( array( 'public' => true ) ) as $type ) {
     1254                    $block_templates = get_block_templates( array( 'post_type' => $type ), 'wp_template' );
    12551255                    foreach ( $block_templates as $block_template ) {
    12561256                        $post_templates[ $type ][ $block_template->slug ] = $block_template->title;
Note: See TracChangeset for help on using the changeset viewer.