From 9e964ba3dc1e76e58459e833c95c21fe6ed461f4 Mon Sep 17 00:00:00 2001 From: yashjawale Date: Fri, 3 Jul 2026 20:06:36 +0530 Subject: [PATCH] fix: use strrpos to account for theme folders that end with parts --- src/wp-includes/block-template-utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/block-template-utils.php b/src/wp-includes/block-template-utils.php index bb04f7767c171..61ac9833d4ff9 100644 --- a/src/wp-includes/block-template-utils.php +++ b/src/wp-includes/block-template-utils.php @@ -417,7 +417,7 @@ function _get_block_templates_files( $template_type, $query = array() ) { $template_slug = substr( $template_file, // Starting position of slug. - strpos( $template_file, $template_base_path . DIRECTORY_SEPARATOR ) + 1 + strlen( $template_base_path ), + strrpos( $template_file, $template_base_path . DIRECTORY_SEPARATOR ) + 1 + strlen( $template_base_path ), // Subtract ending '.html'. -5 );