Themes: Remove memoization from stylesheet and theme directories.

This fixes bugs introduced in [56635] whereby the template or stylesheet path could be memoized incorrectly if `get_template_directory()` or `get_stylesheet_directory()` were called before the theme has been fully initialized.

Props partyfrikadelle, coreyw, kdowns, rebasaurus, meta4, flixos90, mukesh27, joemcgill.
Fixes #59847.


git-svn-id: https://develop.svn.wordpress.org/trunk@57129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe McGill
2023-11-20 22:27:17 +00:00
parent 30954f7ac0
commit b6bf3553d9
9 changed files with 211 additions and 78 deletions

View File

@@ -0,0 +1,7 @@
<?php
// Dummy theme.
echo __DIR__ . '/' . basename(__FILE__);
?>

View File

@@ -0,0 +1,7 @@
<?php
// Dummy theme.
echo __DIR__ . '/' . basename(__FILE__);
?>

View File

@@ -0,0 +1,12 @@
/*
Theme Name: Test Parent Theme
Theme URI: http://example.org/
Description: An example parent theme
Version: 1.3
Author: Minnie Bannister
Author URI: http://example.com/
Template: test-parent
*/

View File

@@ -0,0 +1,7 @@
<?php
// Dummy theme.
echo __DIR__ . '/' . basename(__FILE__);
?>

View File

@@ -0,0 +1,7 @@
<?php
// Dummy theme.
echo __DIR__ . '/' . basename(__FILE__);
?>

View File

@@ -0,0 +1,12 @@
/*
Theme Name: Test Theme
Theme URI: http://example.org/
Description: An example theme
Version: 1.3
Author: Minnie Bannister
Author URI: http://example.com/
Template: test-parent
*/