Skip to content

Commit e4ecc6b

Browse files
committed
Inline theme_supports_block_templates
1 parent 71d29fc commit e4ecc6b

File tree

6 files changed

+5
-14
lines changed

6 files changed

+5
-14
lines changed

src/wp-admin/edit-form-blocks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
'supportsLayout' => WP_Theme_JSON_Resolver::theme_has_support(),
213213
'__experimentalBlockPatterns' => WP_Block_Patterns_Registry::get_instance()->get_all_registered(),
214214
'__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(),
215-
'supportsTemplateMode' => theme_supports_block_templates(),
215+
'supportsTemplateMode' => current_theme_supports( 'block-templates' ),
216216

217217
// Whether or not to load the 'postcustom' meta box is stored as a user meta
218218
// field so that we're not always loading its assets.

src/wp-includes/class-wp-theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ public function get_post_templates() {
12201220
}
12211221
}
12221222

1223-
if ( theme_supports_block_templates() ) {
1223+
if ( current_theme_supports( 'block-templates' ) ) {
12241224
$block_templates = get_block_templates( array(), 'wp_template' );
12251225
foreach ( get_post_types( array( 'public' => true ) ) as $type ) {
12261226
foreach ( $block_templates as $block_template ) {

src/wp-includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ function create_initial_post_types() {
310310
)
311311
);
312312

313-
if ( theme_supports_block_templates() ) {
313+
if ( current_theme_supports( 'block-templates' ) ) {
314314
register_post_type(
315315
'wp_template',
316316
array(

src/wp-includes/taxonomy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function create_initial_taxonomies() {
173173
)
174174
);
175175

176-
if ( theme_supports_block_templates() ) {
176+
if ( current_theme_supports( 'block-templates' ) ) {
177177
register_taxonomy(
178178
'wp_theme',
179179
array( 'wp_template' ),

src/wp-includes/theme-templates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID
7777
function the_block_template_skip_link() {
7878

7979
// Early exit if not an FSE theme.
80-
if ( ! theme_supports_block_templates() ) {
80+
if ( ! current_theme_supports( 'block-templates' ) ) {
8181
return;
8282
}
8383
?>

src/wp-includes/theme.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,15 +3232,6 @@ function get_registered_theme_feature( $feature ) {
32323232
return isset( $_wp_registered_theme_features[ $feature ] ) ? $_wp_registered_theme_features[ $feature ] : null;
32333233
}
32343234

3235-
/**
3236-
* Returns whether the current theme supports block templates
3237-
*
3238-
* @return boolean Whether the current theme supports block templates.
3239-
*/
3240-
function theme_supports_block_templates() {
3241-
return current_theme_supports( 'block-templates' );
3242-
}
3243-
32443235
/**
32453236
* Checks an attachment being deleted to see if it's a header or background image.
32463237
*

0 commit comments

Comments
 (0)