Bläddra i källkod

:bug: trying to swap p2p comparison

tags/0.9.0
J 4 år sedan
förälder
incheckning
a7c68981c4
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3
    2
      plugins/cia-endpoints/includes/class.make-sortby.php

+ 3
- 2
plugins/cia-endpoints/includes/class.make-sortby.php Visa fil

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

Laddar…
Avbryt
Spara