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

See #34403

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


git-svn-id: http://core.svn.wordpress.org/trunk@35335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2015-10-23 07:35:25 +00:00
parent d63f346cbc
commit c9d0c0a9bd

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 );
}
}