diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 7cde57f4f9..6ed07f0d85 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -1283,24 +1283,24 @@ 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 ) { - foreach ( $block_templates as $block_template ) { - if ( ! $block_template->is_custom ) { - continue; - } + $this->cache_add( 'post_templates', $post_templates ); + } - if ( isset( $block_template->post_types ) && ! in_array( $type, $block_template->post_types, true ) ) { - continue; - } - - $post_templates[ $type ][ $block_template->slug ] = $block_template->title; + if ( current_theme_supports( 'block-templates' ) ) { + $block_templates = get_block_templates( array(), 'wp_template' ); + foreach ( get_post_types( array( 'public' => true ) ) as $type ) { + foreach ( $block_templates as $block_template ) { + if ( ! $block_template->is_custom ) { + continue; } + + if ( isset( $block_template->post_types ) && ! in_array( $type, $block_template->post_types, true ) ) { + continue; + } + + $post_templates[ $type ][ $block_template->slug ] = $block_template->title; } } - - $this->cache_add( 'post_templates', $post_templates ); } if ( $this->load_textdomain() ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index c904bc4138..c8af02ce42 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55938'; +$wp_version = '6.3-alpha-55939'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.