From ddeae5feee5cf59a21445a5bd64986f61c7bd4fc Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 14 Oct 2016 13:32:29 +0000 Subject: [PATCH] Themes: Do not show an update button if there's no update package. This updates the list view to match the existing behaviour in the single theme modal. Props tristangemus for initial patch. Fixes #37774. git-svn-id: https://develop.svn.wordpress.org/trunk@38788 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/theme.php | 1 + src/wp-admin/themes.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php index b5fc98042d..fdd5d80d82 100644 --- a/src/wp-admin/includes/theme.php +++ b/src/wp-admin/includes/theme.php @@ -572,6 +572,7 @@ function wp_prepare_themes_for_js( $themes = null ) { 'parent' => $parent, 'active' => $slug === $current_theme, 'hasUpdate' => isset( $updates[ $slug ] ), + 'hasPackage' => isset( $updates[ $slug ] ) && ! empty( $updates[ $slug ][ 'package' ] ), 'update' => get_theme_update_available( $theme ), 'actions' => array( 'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null, diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index fa1b25af5a..3be8fba9af 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -378,7 +378,11 @@ $can_install = current_user_can( 'install_themes' ); <# } #> <# if ( data.hasUpdate ) { #> -

Update now' ); ?>

+ <# if ( data.hasPackage ) { #> +

Update now' ); ?>

+ <# } else { #> +

+ <# } #> <# } #>