Make WordPress Core


Ignore:
Timestamp:
03/08/2012 05:08:55 PM (13 years ago)
Author:
nacin
Message:

Don't show the Network Enable link for broken themes. Include broken themes in searching on network/themes.php. fixes #20099, see #20103.

File:
1 edited

Legend:

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

    r20151 r20160  
    8989        if ( $s ) {
    9090            $status = 'search';
    91             $themes['search'] = array_filter( $themes['all'], array( &$this, '_search_callback' ) );
     91            $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( &$this, '_search_callback' ) );
    9292        }
    9393
     
    284284        $theme_key = $theme->get_stylesheet();
    285285
    286         if ( ! $allowed )
    287             $actions['enable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=enable&amp;theme=' . $theme_key . '&amp;paged=' . $page . '&amp;s=' . $s, 'enable-theme_' . $theme_key) ) . '" title="' . esc_attr__('Enable this theme') . '" class="edit">' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . '</a>';
    288         else
     286        if ( ! $allowed ) {
     287            if ( ! $theme->errors() )
     288                $actions['enable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=enable&amp;theme=' . $theme_key . '&amp;paged=' . $page . '&amp;s=' . $s, 'enable-theme_' . $theme_key) ) . '" title="' . esc_attr__('Enable this theme') . '" class="edit">' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . '</a>';
     289        } else {
    289290            $actions['disable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=disable&amp;theme=' . $theme_key . '&amp;paged=' . $page . '&amp;s=' . $s, 'disable-theme_' . $theme_key) ) . '" title="' . esc_attr__('Disable this theme') . '">' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . '</a>';
     291        }
    290292
    291293        if ( current_user_can('edit_themes') )
     
    324326                case 'description':
    325327                    echo "<td class='column-description desc'$style>";
    326                     if ( $theme->errors() )
    327                         echo '<p><strong>' . $theme->errors()->get_error_message() . '</strong></p>';
     328                    if ( $theme->errors() ) {
     329                        $pre = $status == 'broken' ? '' : __( 'Broken Theme:' ) . ' ';
     330                        echo '<p><strong class="attention">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
     331                    }
    328332                    echo "<div class='theme-description'><p>" . $theme->display( 'Description' ) . "</p></div>
    329333                        <div class='$class second theme-version-author-uri'>";
Note: See TracChangeset for help on using the changeset viewer.