Add 'Details' links to installed plugins.

Installed plugins that are up to date are now returned in the update-check API response.

props tellyworth.
see #17902.

Built from https://develop.svn.wordpress.org/trunk@29226


git-svn-id: http://core.svn.wordpress.org/trunk@29010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2014-07-18 20:49:17 +00:00
parent 4da975b68f
commit 860f0922b7
2 changed files with 28 additions and 0 deletions

View File

@@ -277,6 +277,7 @@ function wp_update_plugins( $extra_stats = array() ) {
'plugins' => json_encode( $to_send ),
'translations' => json_encode( $translations ),
'locale' => json_encode( $locales ),
'all' => json_encode( true ),
),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
);
@@ -303,13 +304,20 @@ function wp_update_plugins( $extra_stats = array() ) {
$plugin = (object) $plugin;
}
unset( $plugin );
foreach ( $response['no_update'] as &$plugin ) {
$plugin = (object) $plugin;
}
unset( $plugin );
if ( is_array( $response ) ) {
$new_option->response = $response['plugins'];
$new_option->translations = $response['translations'];
// TODO: Perhaps better to store no_update in a separate transient with an expiry?
$new_option->no_update = $response['no_update'];
} else {
$new_option->response = array();
$new_option->translations = array();
$new_option->no_update = array();
}
set_site_transient( 'update_plugins', $new_option );