Make WordPress Core


Ignore:
Timestamp:
12/15/2009 07:09:55 PM (15 years ago)
Author:
ryan
Message:

Show plugin compatibility for available upgrade versions of WP. see #10973

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/update-core.php

    r12374 r12407  
    144144        return;
    145145    $form_action = 'update-core.php?action=do-plugin-upgrade';
     146
     147    $core_updates = get_core_updates();
     148    if ( !isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response )
     149        $core_update_version = false;
     150    else
     151        $core_update_version = $core_updates[0]->current;
    146152    ?>
    147153<h3><?php _e('Plugins'); ?></h3>
     
    168174    foreach ( (array) $plugins as $plugin_file => $plugin_data) {
    169175        $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
     176        // Get plugin compat for running version of WordPress.
    170177        if ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {
    171178            $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
    172             $compat = '  ' . sprintf(__('Compatibility: %1$d%% (%2$d "works" votes out of %3$d total)'), $compat[0], $compat[2], $compat[1]);
     179            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
    173180        } else {
    174             $compat = '';
    175         }
     181            $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown)'), $cur_wp_version);
     182        }
     183        // Get plugin compat for updated version of WordPress.
     184        if ( $core_update_version ) {
     185            if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) {
     186                $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
     187                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
     188            } else {
     189                $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
     190            }
     191        }
     192        // Get the upgrade notice for the new plugin version.
    176193        if ( isset($plugin_data->update->upgrade_notice) ) {
    177194            $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
Note: See TracChangeset for help on using the changeset viewer.