summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2025-06-19 22:35:46 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2025-06-19 22:35:46 +0000
commitd50235c0fa7b58c55cd7f34b28ec68c16e6582c1 (patch)
treeaf67bf5c847b85cf9e5d187a68c46f99b42d3d1b
parente2d67edf6e702ed6bb4c6709ead6fd2fa272d227 (diff)
downloadwordpress-d50235c0fa7b58c55cd7f34b28ec68c16e6582c1.tar.gz
wordpress-d50235c0fa7b58c55cd7f34b28ec68c16e6582c1.zip
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
-rw-r--r--src/wp-includes/block-template-utils.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php
index faea7d5e83..0659ade277 100644
--- a/src/wp-includes/block-template-utils.php
+++ b/src/wp-includes/block-template-utils.php
@@ -344,11 +344,8 @@ function _get_block_template_file( $template_type, $slug ) {
return _add_block_template_part_area_info( $new_template_item );
}
- if ( 'wp_template' === $template_type ) {
- return _add_block_template_info( $new_template_item );
- }
-
- return $new_template_item;
+ // If it's not a `wp_template_part`, it must be a `wp_template`.
+ return _add_block_template_info( $new_template_item );
}
}