Fetch the raw 'Template' header in the WP_Theme constructor. By passing sanitization routines (which are unnecessary for this header), we prevent a persistent themes cache from sanitizing the headers of every theme until/unless they actually need a real header like Name. Note that if WP_Theme was instantiated through get_themes(), this will have no effect, as get_themes() does ask for Name for the keys to return. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
524472fca7
commit
19b1746cc6
|
@ -199,7 +199,7 @@ final class WP_Theme implements ArrayAccess {
|
|||
}
|
||||
|
||||
// (If template is set from cache, we know it's good.)
|
||||
if ( ! $this->template && ! ( $this->template = $this->get('Template') ) ) {
|
||||
if ( ! $this->template && ! ( $this->template = $this->headers['Template'] ) ) {
|
||||
if ( file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) {
|
||||
$this->template = $this->stylesheet;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue