Skip to content

Commit

Permalink
phpcbf
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Dec 9, 2021
1 parent 5577aee commit b7af15e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/compat/wordpress-5.9/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,18 +755,18 @@ function gutenberg_get_block_template( $id, $template_type = 'wp_template' ) {
if ( count( $parts ) < 2 ) {
return null;
}
list( $theme, $slug ) = $parts;
list( , $slug ) = $parts;
$block_template = resolve_block_template( $slug, array(), '' );
if ( ! $block_template ) {
$block_template = resolve_block_template( 'index', array(), '' );
}
// This might give us a fallback template with a different ID,
// so we have to override it to make sure it's correct.
$block_template->id = $id;
$block_template->slug = $slug;
$block_template->id = $id;
$block_template->slug = $slug;
$default_template_types = get_default_block_template_types();
if ( array_key_exists( $slug, $default_template_types ) ) {
$block_template->title = $default_template_types[ $slug ]['title'];
$block_template->title = $default_template_types[ $slug ]['title'];
$block_template->description = $default_template_types[ $slug ]['description'];
}

Expand Down

0 comments on commit b7af15e

Please sign in to comment.