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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user