mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
Themes: Report theme as broken that sets itself as its parent.
Props davilera. Fixes #40820. git-svn-id: https://develop.svn.wordpress.org/trunk@41601 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -250,6 +250,14 @@ final class WP_Theme implements ArrayAccess {
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->template && $this->stylesheet === $this->headers['Template'] ) {
|
||||
/* translators: %s: Template */
|
||||
$this->errors = new WP_Error( 'theme_child_invalid', sprintf( __( 'The theme defines itself as its parent theme. Please check the "%s" header.' ), 'Template' ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet ) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// (If template is set from cache [and there are no errors], we know it's good.)
|
||||
if ( ! $this->template && ! ( $this->template = $this->headers['Template'] ) ) {
|
||||
$this->template = $this->stylesheet;
|
||||
|
||||
Reference in New Issue
Block a user