diff --git a/wp-includes/rest-api/class-wp-rest-response.php b/wp-includes/rest-api/class-wp-rest-response.php index fed1a3124d..db80029038 100644 --- a/wp-includes/rest-api/class-wp-rest-response.php +++ b/wp-includes/rest-api/class-wp-rest-response.php @@ -243,8 +243,12 @@ class WP_REST_Response extends WP_HTTP_Response { $error = new WP_Error; if ( is_array( $this->get_data() ) ) { - foreach ( $this->get_data() as $err ) { - $error->add( $err['code'], $err['message'], $err['data'] ); + $data = $this->get_data(); + $error->add( $data['code'], $data['message'], $data['data'] ); + if ( ! empty( $data['additional_errors'] ) ) { + foreach( $data['additional_errors'] as $err ) { + $error->add( $err['code'], $err['message'], $err['data'] ); + } } } else { $error->add( $this->get_status(), '', array( 'status' => $this->get_status() ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 7569830f67..895e7fd606 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta4-35670'; +$wp_version = '4.4-beta4-35671'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.