From 48f5508fc9d703a2b9f3d84f34d74050a7b13813 Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Mon, 19 Jun 2023 16:04:22 +0000 Subject: [PATCH] Themes: Change the order of path check in is_block_theme method. Change check to see if the current theme is a block theme, to check the path `/templates/index.html` first over the deprecated path `/block-templates/index.html`. As this path was deprecated in WP 5.9, it is more likely the block theme would use the current path. This saves a file_exists call which improves performance. Props nihar007, spacedmonkey. Fixes #58520. Built from https://develop.svn.wordpress.org/trunk@55941 git-svn-id: http://core.svn.wordpress.org/trunk@55453 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 6ed07f0d85..827e43de91 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -1515,8 +1515,8 @@ final class WP_Theme implements ArrayAccess { } $paths_to_index_block_template = array( - $this->get_file_path( '/block-templates/index.html' ), $this->get_file_path( '/templates/index.html' ), + $this->get_file_path( '/block-templates/index.html' ), ); $this->block_theme = false; diff --git a/wp-includes/version.php b/wp-includes/version.php index 62a8fc7655..28c00ecce3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55940'; +$wp_version = '6.3-alpha-55941'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.