WordPress.org

Make WordPress Core

Ticket #37774: 37774.4.diff

File 37774.4.diff, 1015 bytes (added by swissspidy, 4 years ago)
  • src/wp-admin/js/theme.js

    diff --git src/wp-admin/js/theme.js src/wp-admin/js/theme.js
    index 1be6f18..924f299 100644
    themes.view.Theme = wp.Backbone.View.extend({ 
    610610
    611611        updateTheme: function( event ) {
    612612                var _this = this;
     613
     614                if ( ! this.model.get( 'hasPackage' ) ) {
     615                        return;
     616                }
     617
    613618                event.preventDefault();
    614619
    615620                wp.updates.maybeRequestFilesystemCredentials( event );
  • src/wp-admin/themes.php

    diff --git src/wp-admin/themes.php src/wp-admin/themes.php
    index 3be8fba..c332f59 100644
    foreach ( $themes as $theme ) : 
    252252
    253253        <?php if ( $theme['hasUpdate'] ) : ?>
    254254                <div class="update-message notice inline notice-warning notice-alt">
     255                <?php if ( $theme['hasPackage'] ) : ?>
    255256                        <p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p>
     257                <?php else : ?>
     258                        <p><?php _e( 'New version available.' ); ?></p>
     259                <?php endif; ?>
    256260                </div>
    257261        <?php endif; ?>
    258262