~canonical-sysadmins/wordpress/4.4.2

« back to all changes in this revision

Viewing changes to wp-includes/class-wp-theme.php

  • Committer: Barry Price
  • Date: 2016-01-07 06:09:42 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: barry.price@canonical.com-20160107060942-1ghv2tqiwm8z0j36
Merge WP4.4.1 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
                } elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
241
241
                        $this->headers['Name'] = $this->stylesheet;
242
242
                        if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
243
 
                                $this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), $this->stylesheet ) );
 
243
                                $this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
244
244
                        else
245
245
                                $this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
246
246
                        $this->template = $this->stylesheet;
287
287
                                $theme_root_template = $directories[ $this->template ]['theme_root'];
288
288
                        } else {
289
289
                                // Parent theme is missing.
290
 
                                $this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), $this->template ) );
 
290
                                $this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
291
291
                                $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
292
292
                                $this->parent = new WP_Theme( $this->template, $this->theme_root, $this );
293
293
                                return;
299
299
                        // If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
300
300
                        if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
301
301
                                $_child->parent = null;
302
 
                                $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
 
302
                                $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
303
303
                                $_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
304
304
                                // The two themes actually reference each other with the Template header.
305
305
                                if ( $_child->stylesheet == $this->template ) {
306
 
                                        $this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $this->template ) );
 
306
                                        $this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
307
307
                                        $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
308
308
                                }
309
309
                                return;