Make WordPress Core


Ignore:
Timestamp:
03/21/2012 04:19:27 PM (14 years ago)
Author:
nacin
Message:

Visually merge a plugin with its update notice. Same applies to themes in the network admin. Move from 'update automatically' to 'update now'. fixes #20273.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-ms-themes-list-table.php

    r20160 r20236  
    7272                }
    7373
    74                 $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && get_site_transient( 'update_themes' );
     74                $maybe_update = current_user_can( 'update_themes' ) && ! $this->is_site_themes && $current = get_site_transient( 'update_themes' );
    7575
    7676                foreach ( (array) $themes['all'] as $key => $theme ) {
     
    8080                        }
    8181
     82                        if ( $maybe_update && isset( $current->response[ $key ] ) ) {
     83                                $themes['all'][ $key ]->update = true;
     84                                $themes['upgrade'][ $key ] = $themes['all'][ $key ];
     85                        }
     86
    8287                        $filter = $theme->is_allowed( $allowed_where, $this->site_id ) ? 'enabled' : 'disabled';
    8388                        $themes[ $filter ][ $key ] = $themes['all'][ $key ];
    84 
    85                         if ( $maybe_update && isset( $current->response[ $key ] ) )
    86                                 $themes['upgrade'][ $key ] = $themes['all'][ $key ];
    8789                }
    8890
     
    262264
    263265        function single_row( $key, $theme ) {
    264                 global $status, $page, $s;
     266                global $status, $page, $s, $totals;
    265267
    266268                $context = $status;
     
    305307
    306308                $id = sanitize_html_class( $theme->get_stylesheet() );
     309
     310                if ( ! empty( $totals['upgrade'] ) && ! empty( $theme->update ) )
     311                        $class .= ' update';
    307312
    308313                echo "<tr id='$id' class='$class'>";
Note: See TracChangeset for help on using the changeset viewer.