diff --git a/wp-admin/css/wp-admin.dev.css b/wp-admin/css/wp-admin.dev.css index 12280219b0..6594b0b42f 100644 --- a/wp-admin/css/wp-admin.dev.css +++ b/wp-admin/css/wp-admin.dev.css @@ -4425,15 +4425,30 @@ input.button-highlighted, padding: 5px 7px 0; } -#wpbody-content .plugins .plugin-title, #wpbody-content .plugins .theme-title { +.plugins .update th, +.plugins .update td { + border-bottom: 0; +} +.plugin-update-tr td { + border-top: 0; +} + +#wpbody-content .plugins .plugin-title, +#wpbody-content .plugins .theme-title { padding-right: 12px; white-space:nowrap; } -.plugins .second, .plugins .row-actions-visible { +.plugins .second, +.plugins .row-actions-visible { padding: 0 0 5px; } +.plugins .update .second, +.plugins .update .row-actions-visible { + padding-bottom: 0; +} + .plugins-php .widefat tfoot th, .plugins-php .widefat tfoot td { border-top-style: solid; 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 84360a4625..9fc3251d70 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -71,7 +71,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { $allowed_where = 'network'; } - $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && get_site_transient( 'update_themes' ); + $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current = get_site_transient( 'update_themes' ); foreach ( (array) $themes['all'] as $key => $theme ) { if ( $this->is_site_themes && $theme->is_allowed( 'network' ) ) { @@ -79,11 +79,13 @@ class WP_MS_Themes_List_Table extends WP_List_Table { continue; } + if ( $maybe_update && isset( $current->response[ $key ] ) ) { + $themes['all'][ $key ]->update = true; + $themes['upgrade'][ $key ] = $themes['all'][ $key ]; + } + $filter = $theme->is_allowed( $allowed_where, $this->site_id ) ? 'enabled' : 'disabled'; $themes[ $filter ][ $key ] = $themes['all'][ $key ]; - - if ( $maybe_update && isset( $current->response[ $key ] ) ) - $themes['upgrade'][ $key ] = $themes['all'][ $key ]; } if ( $s ) { @@ -261,7 +263,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { } function single_row( $key, $theme ) { - global $status, $page, $s; + global $status, $page, $s, $totals; $context = $status; @@ -305,6 +307,9 @@ class WP_MS_Themes_List_Table extends WP_List_Table { $id = sanitize_html_class( $theme->get_stylesheet() ); + if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) ) + $class .= ' update'; + echo "
' . __('There is a new version of %1$s available. View version %3$s details. Automatic update is unavailable for this theme.') . '
', $theme_name, $details_url, $update['new_version']); else - printf( '' . __('There is a new version of %1$s available. View version %3$s details or update automatically.') . '
', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick ); + printf( '' . __('There is a new version of %1$s available. View version %3$s details or update now.') . '
', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick ); } } } diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index c69c3c0a46..c1ffd3c305 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -199,7 +199,7 @@ function wp_plugin_update_row( $file, $plugin_data ) { else if ( empty($r->package) ) printf( __('There is a new version of %1$s available. View version %4$s details. Automatic update is unavailable for this plugin.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); else - printf( __('There is a new version of %1$s available. View version %4$s details or update automatically.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) ); + printf( __('There is a new version of %1$s available. View version %4$s details or update now.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) ); do_action( "in_plugin_update_message-$file", $plugin_data, $r ); @@ -271,7 +271,7 @@ function wp_theme_update_row( $theme_key, $theme ) { else if ( empty( $r['package'] ) ) printf( __('There is a new version of %1$s available. View version %4$s details. Automatic update is unavailable for this theme.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'] ); else - printf( __('There is a new version of %1$s available. View version %4$s details or update automatically.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) ); + printf( __('There is a new version of %1$s available. View version %4$s details or update now.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) ); do_action( "in_theme_update_message-$theme_key", $theme, $r );