Skip to content

Commit d50235c

Browse files
Coding Standards: Remove unreachable return in _get_block_template_file().
This commit removes an unreachable `return` statement, as the function will bail early if `$template_type` is not a `wp_template` or `wp_template_part`. For the same reason, the second `if` conditional was also redundant and is now removed. Follow-up to [52062]. Props justlevine. See #63268. git-svn-id: https://develop.svn.wordpress.org/trunk@60328 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e2d67ed commit d50235c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/wp-includes/block-template-utils.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,8 @@ function _get_block_template_file( $template_type, $slug ) {
344344
return _add_block_template_part_area_info( $new_template_item );
345345
}
346346

347-
if ( 'wp_template' === $template_type ) {
348-
return _add_block_template_info( $new_template_item );
349-
}
350-
351-
return $new_template_item;
347+
// If it's not a `wp_template_part`, it must be a `wp_template`.
348+
return _add_block_template_info( $new_template_item );
352349
}
353350
}
354351

0 commit comments

Comments
 (0)