Fill `$plugins['upgrade']` with extra info for use in list table

Shiny updates depends upon information from the update_plugins site transient in order to set data- attributes which are used by JavaScript. Since /wp-admin/plugins.php?plugin_status=upgrade uses `$plugin['upgrade']` rather than `$plugins['all']`, we need to fill that information in both places.   

Fixes #31738.



git-svn-id: https://develop.svn.wordpress.org/trunk@31872 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Aaron Jorbin 2015-03-24 17:29:32 +00:00
parent d6b90486d1
commit 0d35447647
1 changed files with 9 additions and 0 deletions

View File

@ -125,8 +125,17 @@ class WP_Plugins_List_Table extends WP_List_Table {
// Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide. // Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide.
if ( isset( $plugin_info->response[ $plugin_file ] ) ) { if ( isset( $plugin_info->response[ $plugin_file ] ) ) {
$plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data ); $plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
// Make sure that $plugins['upgrade'] also recieves the extra info since it is used on ?plugin_status=upgrade
if (isset( $plugins['upgrade'][ $plugin_file ] ) ) {
$plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
}
} elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) { } elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) {
$plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data ); $plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
// Make sure that $plugins['upgrade'] also recieves the extra info since it is used on ?plugin_status=upgrade
if (isset( $plugins['upgrade'][ $plugin_file ] ) ) {
$plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
}
} }
// Filter into individual sections // Filter into individual sections