WordPress.org

Make WordPress Core

Ticket #21670: 21670.2.diff

File 21670.2.diff, 2.7 KB (added by nacin, 7 years ago)
  • wp-includes/class-wp-theme.php

     
    206206                } elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
    207207                        $this->headers['Name'] = $this->stylesheet;
    208208                        if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
    209                                 $this->errors = new WP_Error( 'theme_not_found', __( 'The theme directory does not exist.' ) );
     209                                $this->errors = new WP_Error( 'theme_not_found', sprintf( __( "The theme directory '%s' does not exist." ), $this->stylesheet ) );
    210210                        else
    211211                                $this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
    212212                        $this->template = $this->stylesheet;
  • wp-admin/includes/dashboard.php

     
    366366
    367367        if ( $theme->errors() ) {
    368368                if ( ! is_multisite() || is_super_admin() )
    369                         echo '<span class="error-message">' . __('ERROR: The themes directory is either empty or doesn&#8217;t exist. Please check your installation.') . '</span>';
     369                        echo '<span class="error-message">' . sprintf( __( 'ERROR: %s' ), $theme->errors()->get_error_message() ) . '</span>';
    370370        } elseif ( ! empty($wp_registered_sidebars) ) {
    371371                $sidebars_widgets = wp_get_sidebars_widgets();
    372372                $num_widgets = 0;
  • wp-admin/themes.php

     
    139139                <?php echo $ct->display('Name'); ?>
    140140        </h4>
    141141
     142<?php
     143if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) {
     144        echo '<p class="error-message">' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '</p>';
     145}
     146
     147if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() )
     148        && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?>
     149
    142150        <div>
    143151                <ul class="theme-info">
    144152                        <li><?php printf( __('By %s'), $ct->display('Author') ); ?></li>
     
    207215        endif; // options || edit_theme_options
    208216        ?>
    209217
     218<?php endif; // theme errors ?>
     219
    210220</div>
    211221
    212222<br class="clear" />
     
    292302                <th><?php _e('Description'); ?></th>
    293303        </tr>
    294304<?php
    295         $alt = '';
    296305        foreach ( $broken_themes as $broken_theme ) {
    297                 $alt = ('class="alternate"' == $alt) ? '' : 'class="alternate"';
    298306                echo "
    299                 <tr $alt>
     307                <tr>
    300308                         <td>" . $broken_theme->get('Name') ."</td>
    301309                         <td>" . $broken_theme->errors()->get_error_message() . "</td>
    302310                </tr>";