From bb4da6448f935afd3eebbccd570fe20d5c9335ae Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 21 Oct 2016 10:35:51 +0000 Subject: [PATCH] Themes: After [38788], further improve the update button when there's no update package. Prevents running shiny install when no package exists. Fixes #37774. git-svn-id: https://develop.svn.wordpress.org/trunk@38855 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/theme.js | 5 +++++ src/wp-admin/themes.php | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 1be6f184ae..924f299716 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -610,6 +610,11 @@ themes.view.Theme = wp.Backbone.View.extend({ updateTheme: function( event ) { var _this = this; + + if ( ! this.model.get( 'hasPackage' ) ) { + return; + } + event.preventDefault(); wp.updates.maybeRequestFilesystemCredentials( event ); diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index e2c0372efb..fb9c21922d 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -252,7 +252,11 @@ foreach ( $themes as $theme ) :
+

Update now' ); ?>

+ +

+