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
This commit is contained in:
Weston Ruter 2015-05-25 22:08:08 +00:00
parent bd06ad2725
commit e95740d7d0

View File

@ -1380,7 +1380,7 @@ final class WP_Customize_Widgets {
$updated_widget = $this->call_widget_update( $widget_id ); // => {instance,form} $updated_widget = $this->call_widget_update( $widget_id ); // => {instance,form}
if ( is_wp_error( $updated_widget ) ) { 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']; $form = $updated_widget['form'];