Shiny Updates: Add ajax-y updates to the plugin list page, and ajax-y updates and installs to the plugin card page.

This also includes JS architecture that can be expanded to support theme, core and language pack updates.

Props pento, ericlewis, lgladdy, adamsilverstein, DrewAPicture

See #29820



git-svn-id: https://develop.svn.wordpress.org/trunk@31333 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2015-02-05 04:18:57 +00:00
parent f205eb63d0
commit 748d595b5c
11 changed files with 488 additions and 31 deletions
+4 -1
View File
@@ -276,6 +276,7 @@ function install_plugin_install_status($api, $loop = false) {
// Default to a "new" plugin
$status = 'install';
$url = false;
$update_file = false;
/*
* Check to see if this plugin is known to be installed,
@@ -304,6 +305,7 @@ function install_plugin_install_status($api, $loop = false) {
} else {
$key = array_keys( $installed_plugin );
$key = array_shift( $key ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
$update_file = $api->slug . '/' . $key;
if ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '=') ){
$status = 'latest_installed';
} elseif ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '<') ) {
@@ -327,7 +329,8 @@ function install_plugin_install_status($api, $loop = false) {
if ( isset($_GET['from']) )
$url .= '&amp;from=' . urlencode( wp_unslash( $_GET['from'] ) );
return compact('status', 'url', 'version');
$file = $update_file;
return compact( 'status', 'url', 'version', 'file' );
}
/**