Make WordPress Core


Ignore:
Timestamp:
03/08/2012 07:32:42 AM (12 years ago)
Author:
nacin
Message:

In multisite, list broken themes on network/themes.php instead of on individual Manage Themes pages. see #20103.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r20147 r20151  
    1717
    1818        $status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : 'all';
    19         if ( !in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search' ) ) )
     19        if ( !in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search', 'broken' ) ) )
    2020            $status = 'all';
    2121
     
    6060            'enabled' => array(),
    6161            'disabled' => array(),
    62             'upgrade' => array()
     62            'upgrade' => array(),
     63            'broken' => $this->is_site_themes ? array() : wp_get_themes( array( 'errors' => true ) ),
    6364        );
    6465
     
    7172        }
    7273
    73         $current = current_user_can( 'update_themes' ) && ! $this->is_site_themes && get_site_transient( 'update_themes' );
     74        $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && get_site_transient( 'update_themes' );
    7475
    7576        foreach ( (array) $themes['all'] as $key => $theme ) {
     
    8283            $themes[ $filter ][ $key ] = $themes['all'][ $key ];
    8384
    84             if ( $current && isset( $current->response[ $key ] ) )
     85            if ( $maybe_update && isset( $current->response[ $key ] ) )
    8586                $themes['upgrade'][ $key ] = $themes['all'][ $key ];
    8687        }
     
    206207                case 'upgrade':
    207208                    $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
     209                    break;
     210                case 'broken' :
     211                    $text = _n( 'Broken <span class="count">(%s)</span>', 'Broken <span class="count">(%s)</span>', $count );
    208212                    break;
    209213            }
     
    298302        $checkbox = "<input type='checkbox' name='checked[]' value='" . esc_attr( $theme_key ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $theme->display('Name') . "</label>";
    299303
    300         $description = '<p>' . $theme->display( 'Description' ) . '</p>';
    301 
    302304        $id = sanitize_html_class( $theme->get_stylesheet() );
    303305
     
    321323                    break;
    322324                case 'description':
    323                     echo "<td class='column-description desc'$style>
    324                         <div class='theme-description'>" . $theme->display( 'Description' ) . "</div>
     325                    echo "<td class='column-description desc'$style>";
     326                    if ( $theme->errors() )
     327                        echo '<p><strong>' . $theme->errors()->get_error_message() . '</strong></p>';
     328                    echo "<div class='theme-description'><p>" . $theme->display( 'Description' ) . "</p></div>
    325329                        <div class='$class second theme-version-author-uri'>";
    326330
Note: See TracChangeset for help on using the changeset viewer.