WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/26/2017 08:53:20 AM (2 years ago)
Author:
swissspidy
Message:

Themes: Report theme as broken that sets itself as its parent.

Props davilera.
Fixes #40820.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme.php

    r41200 r41601  
    249249                    $this->headers['Name'] .= '/' . $this->stylesheet;
    250250            }
     251        }
     252
     253        if ( ! $this->template && $this->stylesheet === $this->headers['Template'] ) {
     254            /* translators: %s: Template */
     255            $this->errors = new WP_Error( 'theme_child_invalid', sprintf( __( 'The theme defines itself as its parent theme. Please check the "%s" header.' ), 'Template' ) );
     256            $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet ) );
     257
     258            return;
    251259        }
    252260
Note: See TracChangeset for help on using the changeset viewer.