From a60ac4684bb29fcf7c914dfda418978e0750b31d Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 14 Oct 2016 13:33: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. Built from https://develop.svn.wordpress.org/trunk@38788 git-svn-id: http://core.svn.wordpress.org/trunk@38731 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme.php | 1 + wp-admin/themes.php | 6 +++++- wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index b5fc98042d..fdd5d80d82 100644 --- a/wp-admin/includes/theme.php +++ b/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/wp-admin/themes.php b/wp-admin/themes.php index fa1b25af5a..3be8fba9af 100644 --- a/wp-admin/themes.php +++ b/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 { #> +

+ <# } #> <# } #> diff --git a/wp-includes/version.php b/wp-includes/version.php index 07f755c745..b03dfb30b7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38787'; +$wp_version = '4.7-alpha-38788'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.