WordPress.org

Make WordPress Core

Changeset 31872


Ignore:
Timestamp:
03/24/2015 05:29:32 PM (6 years ago)
Author:
jorbin
Message:

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.

File:
1 edited

Legend:

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

    r31834 r31872  
    126126            if ( isset( $plugin_info->response[ $plugin_file ] ) ) {
    127127                $plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
     128                // Make sure that $plugins['upgrade'] also recieves the extra info since it is used on ?plugin_status=upgrade
     129                if (isset( $plugins['upgrade'][ $plugin_file ] ) ) {
     130                    $plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->response[ $plugin_file ], $plugin_data );
     131                }
     132
    128133            } elseif ( isset( $plugin_info->no_update[ $plugin_file ] ) ) {
    129134                $plugins['all'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
     135                // Make sure that $plugins['upgrade'] also recieves the extra info since it is used on ?plugin_status=upgrade
     136                if (isset( $plugins['upgrade'][ $plugin_file ] ) ) {
     137                    $plugins['upgrade'][ $plugin_file ] = $plugin_data = array_merge( (array) $plugin_info->no_update[ $plugin_file ], $plugin_data );
     138                }
    130139            }
    131140
Note: See TracChangeset for help on using the changeset viewer.