From e95740d7d0d24d244f34bc8826fdfdf409caeb82 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 25 May 2015 22:08:08 +0000 Subject: [PATCH] Fix wp_send_json_error() response for update-widget Ajax request, to return error code instead of error message, as the WP_Error objects are instantiated with codes and the messages are empty. Fixes #32496. git-svn-id: https://develop.svn.wordpress.org/trunk@32601 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-widgets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index bf0d3eca79..cfd0541aa0 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -1380,7 +1380,7 @@ final class WP_Customize_Widgets { $updated_widget = $this->call_widget_update( $widget_id ); // => {instance,form} if ( is_wp_error( $updated_widget ) ) { - wp_send_json_error( $updated_widget->get_error_message() ); + wp_send_json_error( $updated_widget->get_error_code() ); } $form = $updated_widget['form'];