Changeset 20315 for trunk/wp-includes/class-wp-theme.php
- Timestamp:
- 03/29/2012 04:16:17 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-theme.php
r20312 r20315 200 200 else 201 201 $this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) ); 202 $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet ) ); 202 $this->template = $this->stylesheet; 203 $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) ); 203 204 if ( ! file_exists( $this->theme_root ) ) // Don't cache this one. 204 205 $this->errors->add( 'theme_root_missing', __( 'ERROR: The themes directory is either empty or doesn’t exist. Please check your installation.' ) ); … … 207 208 $this->headers['Name'] = $this->stylesheet; 208 209 $this->errors = new WP_Error( 'theme_stylesheet_not_readable', __( 'Stylesheet is not readable.' ) ); 209 $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet ) ); 210 $this->template = $this->stylesheet; 211 $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) ); 210 212 return; 211 213 } else { … … 219 221 } 220 222 221 // (If template is set from cache , we know it's good.)223 // (If template is set from cache [and there are no errors], we know it's good.) 222 224 if ( ! $this->template && ! ( $this->template = $this->headers['Template'] ) ) { 223 if ( file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) { 224 $this->template = $this->stylesheet; 225 } else { 225 $this->template = $this->stylesheet; 226 if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) { 226 227 $this->errors = new WP_Error( 'theme_no_index', __( 'Template is missing.' ) ); 227 $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet ) );228 $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) ); 228 229 return; 229 230 }
Note: See TracChangeset
for help on using the changeset viewer.