|
|
@@ -149,11 +149,13 @@ class Make_Sort_By extends WP_REST_Controller {
|
|
149
|
149
|
}
|
|
150
|
150
|
|
|
151
|
151
|
public function prepare_items_for_reponse( $items ) {
|
|
152
|
|
- $collection = array();
|
|
153
|
|
- $formatted = default_post_format($item, false);
|
|
154
|
|
- $formatted[hero] = get_post_meta( $post->ID, 'hero_header', true );
|
|
|
152
|
+ $collection = [];
|
|
155
|
153
|
|
|
156
|
|
- forEach( $items as $key => $item ) $collection[$key] = $formatted;
|
|
|
154
|
+ forEach( $items as $item ) {
|
|
|
155
|
+ $formatted = default_post_format($item, false);
|
|
|
156
|
+ $formatted[hero] = get_post_meta( $item->ID, 'hero_header', true );
|
|
|
157
|
+ array_push($collection, $formatted);
|
|
|
158
|
+ }
|
|
157
|
159
|
|
|
158
|
160
|
return $collection;
|
|
159
|
161
|
}
|