From f173370ae181b5c66c79f151c4e97dc78fa458b3 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 8 Mar 2012 17:08:55 +0000 Subject: [PATCH] Don't show the Network Enable link for broken themes. Include broken themes in searching on network/themes.php. fixes #20099, see #20103. git-svn-id: https://develop.svn.wordpress.org/trunk@20160 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-wp-ms-themes-list-table.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/class-wp-ms-themes-list-table.php b/wp-admin/includes/class-wp-ms-themes-list-table.php index 0b87b7c744..84360a4625 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -88,7 +88,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { if ( $s ) { $status = 'search'; - $themes['search'] = array_filter( $themes['all'], array( &$this, '_search_callback' ) ); + $themes['search'] = array_filter( array_merge( $themes['all'], $themes['broken'] ), array( &$this, '_search_callback' ) ); } $totals = array(); @@ -283,10 +283,12 @@ class WP_MS_Themes_List_Table extends WP_List_Table { $theme_key = $theme->get_stylesheet(); - if ( ! $allowed ) - $actions['enable'] = '' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . ''; - else + if ( ! $allowed ) { + if ( ! $theme->errors() ) + $actions['enable'] = '' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . ''; + } else { $actions['disable'] = '' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . ''; + } if ( current_user_can('edit_themes') ) $actions['edit'] = '' . __('Edit') . ''; @@ -323,8 +325,10 @@ class WP_MS_Themes_List_Table extends WP_List_Table { break; case 'description': echo ""; - if ( $theme->errors() ) - echo '

' . $theme->errors()->get_error_message() . '

'; + if ( $theme->errors() ) { + $pre = $status == 'broken' ? '' : __( 'Broken Theme:' ) . ' '; + echo '

' . $pre . $theme->errors()->get_error_message() . '

'; + } echo "

" . $theme->display( 'Description' ) . "

";