|
|
@@ -141,6 +141,7 @@ class Make_Sort_By extends WP_REST_Controller {
|
|
141
|
141
|
// $args['max'] $q->max_num_pages;
|
|
142
|
142
|
$found_posts = $q->get_posts();
|
|
143
|
143
|
wp_reset_postdata();
|
|
|
144
|
+
|
|
144
|
145
|
return new WP_REST_Response( $this->prepare_items_for_reponse($found_posts, true), 200 );
|
|
145
|
146
|
}
|
|
146
|
147
|
|
|
|
@@ -148,9 +149,9 @@ class Make_Sort_By extends WP_REST_Controller {
|
|
148
|
149
|
$collection = [];
|
|
149
|
150
|
|
|
150
|
151
|
forEach( $items as $item ) {
|
|
151
|
|
- $formatted = default_post_format($item, false);
|
|
|
152
|
+ $formatted = default_post_format( $item, false );
|
|
152
|
153
|
$formatted[hero] = get_post_meta( $item->ID, 'hero_header', true );
|
|
153
|
|
- if($p2p == true) {
|
|
|
154
|
+ if($p2p) {
|
|
154
|
155
|
$formatted[relatedto] = p2p_related_to( $item->ID );
|
|
155
|
156
|
}
|
|
156
|
157
|
array_push($collection, $formatted);
|