diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index a6966351f185f..da591e7def500 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -361,7 +361,7 @@ public function __construct( $theme_dir, $theme_root, $_child = null ) { } if ( ! $this->template && $this->stylesheet === $this->headers['Template'] ) { - $this->errors = new WP_Error( + $this->errors = new WP_Error( 'theme_child_invalid', sprintf( /* translators: %s: Template. */ @@ -369,6 +369,7 @@ public function __construct( $theme_dir, $theme_root, $_child = null ) { 'Template' ) ); + $this->template = $this->stylesheet; $this->cache_add( 'theme', array( @@ -377,6 +378,7 @@ public function __construct( $theme_dir, $theme_root, $_child = null ) { 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, + 'template' => $this->template, ) );