Changeset 51003 for trunk/src/wp-includes/class-wp-theme.php
- Timestamp:
- 05/25/2021 02:19:14 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r50810 r51003 1183 1183 * 1184 1184 * @since 4.7.0 1185 * @since 5.8.0 Include block templates. 1185 1186 * 1186 1187 * @return string[] Array of page templates, keyed by filename and post type, … … 1217 1218 1218 1219 $post_templates[ $type ][ $file ] = _cleanup_header_comment( $header[1] ); 1220 } 1221 } 1222 1223 if ( current_theme_supports( 'block-templates' ) ) { 1224 $block_templates = get_block_templates( array(), 'wp_template' ); 1225 foreach ( get_post_types( array( 'public' => true ) ) as $type ) { 1226 foreach ( $block_templates as $block_template ) { 1227 $post_templates[ $type ][ $block_template->slug ] = $block_template->title; 1228 } 1219 1229 } 1220 1230 }
Note: See TracChangeset
for help on using the changeset viewer.