|
|
@@ -167,7 +167,7 @@ class Make_Sort_By extends WP_REST_Controller {
|
|
167
|
167
|
ON (wp_p2p.p2p_from = wp_posts.ID OR wp_p2p.p2p_to = wp_posts.ID)
|
|
168
|
168
|
LEFT JOIN wp_posts AS header
|
|
169
|
169
|
ON header.ID = IF(wp_posts.ID = wp_p2p.p2p_to, wp_p2p.p2p_from, wp_p2p.p2p_to)
|
|
170
|
|
- WHERE wp_posts.post_status = 'publish'
|
|
|
170
|
+ WHERE wp_posts.post_type = %s AND wp_posts.post_status = 'publish'
|
|
171
|
171
|
AND (wp_p2p.p2p_type = %s OR wp_p2p.p2p_type = %s)
|
|
172
|
172
|
ORDER BY header.post_date DESC, related_episode, wp_posts.post_date DESC",
|
|
173
|
173
|
trim($type, 's'), $type . '_to_episodes' , 'episodes_to_' . $type,
|