WordPress.org

Make WordPress Core

Changeset 16372


Ignore:
Timestamp:
11/14/2010 06:34:59 PM (9 years ago)
Author:
scribu
Message:

Don't display upgradeable plugins in site admin and only translate plugin data for currently displayed plugins. See #14435

File:
1 edited

Legend:

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

    r16350 r16372  
    6565            if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
    6666                $plugins['dropins'] = get_dropins();
     67
     68            $current = get_site_transient( 'update_plugins' );
     69            foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
     70                if ( isset( $current->response[ $plugin_file ] ) )
     71                    $plugins['upgrade'][ $plugin_file ] = $plugin_data;
     72            }
    6773        }
    6874
     
    7682                unset( $recently_activated[$key] );
    7783        update_option( 'recently_activated', $recently_activated );
    78 
    79         $current = get_site_transient( 'update_plugins' );
    80 
    81         foreach ( array( 'all', 'mustuse', 'dropins' ) as $type ) {
    82             foreach ( (array) $plugins[$type] as $plugin_file => $plugin_data ) {
    83                 // Translate, Apply Markup, Sanitize HTML
    84                 $plugins[$type][$plugin_file] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );
    85             }
    86         }
    8784
    8885        foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
     
    10198                $plugins['inactive'][ $plugin_file ] = $plugin_data;
    10299            }
    103 
    104             if ( isset( $current->response[ $plugin_file ] ) )
    105                 $plugins['upgrade'][ $plugin_file ] = $plugin_data;
    106100        }
    107101
     
    121115            $status = 'all';
    122116
    123         $this->items = $plugins[ $status ];
     117        $this->items = array();
     118        foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) {
     119            // Translate, Apply Markup, Sanitize HTML
     120            $this->items[$plugin_file] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );
     121        }
     122
    124123        $total_this_page = $totals[ $status ];
    125124
Note: See TracChangeset for help on using the changeset viewer.