diff --git a/src/Properties/ThemeProperties.php b/src/Properties/ThemeProperties.php index d84b3ad..c1bdf05 100644 --- a/src/Properties/ThemeProperties.php +++ b/src/Properties/ThemeProperties.php @@ -72,7 +72,7 @@ protected function __construct(string $themeDirectory) } $baseName = $theme->get_stylesheet(); - $basePath = $theme->get_template_directory(); + $basePath = $theme->get_stylesheet_directory(); $baseUrl = (string) trailingslashit($theme->get_stylesheet_directory_uri()); parent::__construct( diff --git a/tests/unit/Properties/ThemePropertiesTest.php b/tests/unit/Properties/ThemePropertiesTest.php index 187f645..2b6ecae 100644 --- a/tests/unit/Properties/ThemePropertiesTest.php +++ b/tests/unit/Properties/ThemePropertiesTest.php @@ -56,7 +56,7 @@ public function testBasic(): void $themeStub->expects('get')->with($key)->andReturn($return); } $themeStub->expects('get_stylesheet')->andReturn($expectedBaseName); - $themeStub->expects('get_template_directory')->andReturn($expectedBasePath); + $themeStub->expects('get_stylesheet_directory')->andReturn($expectedBasePath); $themeStub->expects('get_stylesheet_directory_uri')->andReturn($expectedBaseUrl); Functions\expect('wp_get_theme')->with($expectedBasePath)->andReturn($themeStub); @@ -109,7 +109,7 @@ public function testChildTheme(): void $themeStub->shouldReceive('get')->zeroOrMoreTimes()->andReturnArg(0); $themeStub->expects('get_stylesheet')->andReturn($expectedBaseName); - $themeStub->expects('get_template_directory')->andReturn($expectedBasePath); + $themeStub->expects('get_stylesheet_directory')->andReturn($expectedBasePath); $themeStub->expects('get_stylesheet_directory_uri')->andReturn($expectedBaseUrl); Functions\expect('wp_get_theme')->with($expectedBasePath)->andReturn($themeStub);