Procházet zdrojové kódy

:bug: stop trimming type by_episode cb

tags/0.9.0
J před 4 roky
rodič
revize
3e809007b5
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. 2
    3
      plugins/cia-endpoints/includes/class.make-sortby.php

+ 2
- 3
plugins/cia-endpoints/includes/class.make-sortby.php Zobrazit soubor

156
     public function by_episode( $request ) {
156
     public function by_episode( $request ) {
157
         $q = new WP_Query($this->make_args($request, null));
157
         $q = new WP_Query($this->make_args($request, null));
158
         global $wpdb;
158
         global $wpdb;
159
-        
160
-        $type = $q->query['post_type'] . 's';
159
+        $type = $q->query['post_type'];
161
         
160
         
162
         // TODO: optimize this query
161
         // TODO: optimize this query
163
         $items = $wpdb->get_results($wpdb->prepare(
162
         $items = $wpdb->get_results($wpdb->prepare(
170
             WHERE wp_posts.post_type = %s AND wp_posts.post_status = 'publish' 
169
             WHERE wp_posts.post_type = %s AND wp_posts.post_status = 'publish' 
171
                 AND (wp_p2p.p2p_type = %s OR wp_p2p.p2p_type = %s) 
170
                 AND (wp_p2p.p2p_type = %s OR wp_p2p.p2p_type = %s) 
172
             ORDER BY header.post_date DESC, related_episode, wp_posts.post_date DESC",
171
             ORDER BY header.post_date DESC, related_episode, wp_posts.post_date DESC",
173
-            trim($type, 's'), $type . '_to_episodes' , 'episodes_to_' . $type,
172
+            $type, $type . 's_to_episodes' , 'episodes_to_' . $type . 's',
174
         ));
173
         ));
175
         wp_reset_postdata();
174
         wp_reset_postdata();
176
 
175
 

Načítá se…
Zrušit
Uložit