Skip to content

Commit

Permalink
Inline theme_supports_block_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed May 25, 2021
1 parent 71d29fc commit e4ecc6b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
'supportsLayout' => WP_Theme_JSON_Resolver::theme_has_support(),
'__experimentalBlockPatterns' => WP_Block_Patterns_Registry::get_instance()->get_all_registered(),
'__experimentalBlockPatternCategories' => WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(),
'supportsTemplateMode' => theme_supports_block_templates(),
'supportsTemplateMode' => current_theme_supports( 'block-templates' ),

// Whether or not to load the 'postcustom' meta box is stored as a user meta
// field so that we're not always loading its assets.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ public function get_post_templates() {
}
}

if ( theme_supports_block_templates() ) {
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 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function create_initial_post_types() {
)
);

if ( theme_supports_block_templates() ) {
if ( current_theme_supports( 'block-templates' ) ) {
register_post_type(
'wp_template',
array(
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function create_initial_taxonomies() {
)
);

if ( theme_supports_block_templates() ) {
if ( current_theme_supports( 'block-templates' ) ) {
register_taxonomy(
'wp_theme',
array( 'wp_template' ),
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/theme-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID
function the_block_template_skip_link() {

// Early exit if not an FSE theme.
if ( ! theme_supports_block_templates() ) {
if ( ! current_theme_supports( 'block-templates' ) ) {
return;
}
?>
Expand Down
9 changes: 0 additions & 9 deletions src/wp-includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -3232,15 +3232,6 @@ function get_registered_theme_feature( $feature ) {
return isset( $_wp_registered_theme_features[ $feature ] ) ? $_wp_registered_theme_features[ $feature ] : null;
}

/**
* Returns whether the current theme supports block templates
*
* @return boolean Whether the current theme supports block templates.
*/
function theme_supports_block_templates() {
return current_theme_supports( 'block-templates' );
}

/**
* Checks an attachment being deleted to see if it's a header or background image.
*
Expand Down

0 comments on commit e4ecc6b

Please sign in to comment.