Changeset 55939
- Timestamp:
- 06/19/2023 10:31:45 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r55885 r55939 1284 1284 } 1285 1285 1286 if ( current_theme_supports( 'block-templates' ) ) { 1287 $block_templates = get_block_templates( array(), 'wp_template' ); 1288 foreach ( get_post_types( array( 'public' => true ) ) as $type ) { 1289 foreach ( $block_templates as $block_template ) { 1290 if ( ! $block_template->is_custom ) { 1291 continue; 1292 } 1293 1294 if ( isset( $block_template->post_types ) && ! in_array( $type, $block_template->post_types, true ) ) { 1295 continue; 1296 } 1297 1298 $post_templates[ $type ][ $block_template->slug ] = $block_template->title; 1286 $this->cache_add( 'post_templates', $post_templates ); 1287 } 1288 1289 if ( current_theme_supports( 'block-templates' ) ) { 1290 $block_templates = get_block_templates( array(), 'wp_template' ); 1291 foreach ( get_post_types( array( 'public' => true ) ) as $type ) { 1292 foreach ( $block_templates as $block_template ) { 1293 if ( ! $block_template->is_custom ) { 1294 continue; 1299 1295 } 1300 } 1301 } 1302 1303 $this->cache_add( 'post_templates', $post_templates ); 1296 1297 if ( isset( $block_template->post_types ) && ! in_array( $type, $block_template->post_types, true ) ) { 1298 continue; 1299 } 1300 1301 $post_templates[ $type ][ $block_template->slug ] = $block_template->title; 1302 } 1303 } 1304 1304 } 1305 1305
Note: See TracChangeset
for help on using the changeset viewer.