Remove extra loop

This commit is contained in:
Claudio Sanches 2020-01-09 17:23:29 -03:00
parent 64f09329dd
commit 7eded142c7
1 changed files with 1 additions and 7 deletions

View File

@ -74,13 +74,7 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
$schema = $this->get_item_schema();
$fields = $this->get_fields_for_response( $request );
$mappings = $this->get_item_mappings( $fields );
$response = array();
foreach ( $mappings as $section => $values ) {
$response[ $section ] = $values;
}
$response = $this->prepare_item_for_response( $response, $request );
$response = $this->prepare_item_for_response( $mappings, $request );
return rest_ensure_response( $response );
}