From f935d4c26b01cb45024ede6f82cac33b1b11df0a Mon Sep 17 00:00:00 2001 From: dd32 Date: Fri, 23 Oct 2015 07:34:02 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/ajax-actions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 0170cd9d70..bc3a756d03 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -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 ); } }