Themes: Account for a numeric theme directory in `WP_Theme::__construct()`.

This ensures that if a theme with a numeric directory name is active, it is correctly identified as such, and that theme support features work as expected.

Follow-up to [20029], [49925].

Props lopo, alvastar, winterpsv, hugodevos, ankit-k-gupta, jakariaistauk, mukesh27, spacedmonkey, SergeyBiryukov.
Fixes #54645.
Built from https://develop.svn.wordpress.org/trunk@55426


git-svn-id: http://core.svn.wordpress.org/trunk@54959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-02-27 15:34:23 +00:00
parent 04967a68b6
commit 58d7cd099e
2 changed files with 4 additions and 1 deletions

View File

@ -242,6 +242,9 @@ final class WP_Theme implements ArrayAccess {
} }
} }
// Handle a numeric theme directory as a string.
$theme_dir = (string) $theme_dir;
$this->theme_root = $theme_root; $this->theme_root = $theme_root;
$this->stylesheet = $theme_dir; $this->stylesheet = $theme_dir;

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.2-beta3-55425'; $wp_version = '6.2-beta3-55426';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.