Make WordPress Core

Changeset 38788


Ignore:
Timestamp:
10/14/2016 01:32:29 PM (8 years ago)
Author:
swissspidy
Message:

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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r38705 r38788  
    573573            'active'       => $slug === $current_theme,
    574574            'hasUpdate'    => isset( $updates[ $slug ] ),
     575            'hasPackage'   => isset( $updates[ $slug ] ) && ! empty( $updates[ $slug ][ 'package' ] ),
    575576            'update'       => get_theme_update_available( $theme ),
    576577            'actions'      => array(
  • trunk/src/wp-admin/themes.php

    r38722 r38788  
    379379
    380380    <# if ( data.hasUpdate ) { #>
    381         <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p></div>
     381        <# if ( data.hasPackage ) { #>
     382            <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p></div>
     383        <# } else { #>
     384            <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available.' ); ?></p></div>
     385        <# } #>
    382386    <# } #>
    383387
Note: See TracChangeset for help on using the changeset viewer.