Make WordPress Core

Changeset 36638


Ignore:
Timestamp:
02/23/2016 05:19:57 PM (9 years ago)
Author:
swissspidy
Message:

Themes: Improve error messages for broken themes.

Props mayukojpn for initial patch.
Fixes #35286.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/themes.php

    r36302 r36638  
    288288
    289289if ( 'broken' == $status )
    290     echo '<p class="clear">' . __('The following themes are installed but incomplete. Themes must have a stylesheet and a template.') . '</p>';
     290    echo '<p class="clear">' . __( 'The following themes are installed but incomplete.' ) . '</p>';
    291291?>
    292292
  • trunk/src/wp-admin/themes.php

    r36422 r36638  
    296296<div class="broken-themes">
    297297<h3><?php _e('Broken Themes'); ?></h3>
    298 <p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p>
     298<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>
    299299
    300300<?php
  • trunk/src/wp-includes/class-wp-theme.php

    r36416 r36638  
    269269            $this->template = $this->stylesheet;
    270270            if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet . '/index.php' ) ) {
    271                 $this->errors = new WP_Error( 'theme_no_index', __( 'Template is missing.' ) );
     271                $error_message = sprintf(
     272                    /* translators: 1: index.php, 2: Codex URL, 3: style.css */
     273                    __( 'Template is missing. Standalone themes need to have a %1$s template file. <a href="%2$s">Child themes</a> need to have a Template header in the %3$s stylesheet.' ),
     274                    '<code>index.php</code>',
     275                    __( 'https://codex.wordpress.org/Child_Themes' ),
     276                    '<code>style.css</code>'
     277                );
     278                $this->errors = new WP_Error( 'theme_no_index', $error_message );
    272279                $this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
    273280                return;
Note: See TracChangeset for help on using the changeset viewer.