WordPress.org

Make WordPress Core

Ticket #11450: 11450.2.diff

File 11450.2.diff, 1.2 KB (added by Denis-de-Bernardy, 5 years ago)

same patch, sticking to major versions

  • wp-admin/update-core.php

     
    174174        foreach ( (array) $plugins as $plugin_file => $plugin_data) { 
    175175                $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug )); 
    176176                // Get plugin compat for running version of WordPress. 
    177                 if ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) { 
     177                if ( preg_match("/^\d+\.\d+/", $cur_wp_version, $_cur_wp_version) 
     178                        $cur_wp_version = end($_cur_wp_version); 
     179                if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=')) ) { 
     180                        $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100% (according to its author)'), $cur_wp_version); 
     181                } elseif ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) { 
    178182                        $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version]; 
    179183                        $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]); 
    180184                } else {