Updates: Add a generic failure case to the ajax update endpoint for when the WP_Error value hasn't been found.

See #34403


git-svn-id: https://develop.svn.wordpress.org/trunk@35371 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
dd32
2015-10-23 07:34:02 +00:00
parent 8c33fe770e
commit f935d4c26b

View File

@@ -3098,6 +3098,7 @@ function wp_ajax_update_plugin() {
* For now, surface some sort of error here.
*/
if ( $plugin_update_data === true ) {
$status['error'] = __( 'Plugin update failed.' );
wp_send_json_error( $status );
}
@@ -3124,6 +3125,10 @@ function wp_ajax_update_plugin() {
wp_send_json_error( $status );
} else {
// An unhandled error occured
$status['error'] = __( 'Plugin update failed.' );
wp_send_json_error( $status );
}
}