| 1 | 366c366 |
|---|
| 2 | < $join = " INNER JOIN $wpdb->term_relationships AS tr ON $wpdb->posts.ID = tr.object_id "; |
|---|
| 3 | --- |
|---|
| 4 | > $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id "; |
|---|
| 5 | 379c379 |
|---|
| 6 | < $posts_in_ex_cats_sql = 'AND ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; |
|---|
| 7 | --- |
|---|
| 8 | > $posts_in_ex_cats_sql = 'AND p.ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; |
|---|
| 9 | 383,384c383,384 |
|---|
| 10 | < $where = apply_filters( 'get_previous_post_where', "WHERE post_date < '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql", $in_same_cat, $excluded_categories ); |
|---|
| 11 | < $sort = apply_filters( 'get_previous_post_sort', 'ORDER BY post_date DESC LIMIT 1' ); |
|---|
| 12 | --- |
|---|
| 13 | > $where = apply_filters( 'get_previous_post_where', "WHERE p.post_date < '$current_post_date' AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql", $in_same_cat, $excluded_categories ); |
|---|
| 14 | > $sort = apply_filters( 'get_previous_post_sort', 'ORDER BY p.post_date DESC LIMIT 1' ); |
|---|
| 15 | 386c386 |
|---|
| 16 | < return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join $where $sort"); |
|---|
| 17 | --- |
|---|
| 18 | > return @$wpdb->get_row("SELECT p.ID, p.post_title FROM $wpdb->posts AS p $join $where $sort"); |
|---|
| 19 | 399c399 |
|---|
| 20 | < $join = " INNER JOIN $wpdb->term_relationships AS tr ON $wpdb->posts.ID = tr.object_id "; |
|---|
| 21 | --- |
|---|
| 22 | > $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id "; |
|---|
| 23 | 412c412 |
|---|
| 24 | < $posts_in_ex_cats_sql = 'AND ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; |
|---|
| 25 | --- |
|---|
| 26 | > $posts_in_ex_cats_sql = 'AND p.ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; |
|---|
| 27 | 416,417c416,417 |
|---|
| 28 | < $where = apply_filters( 'get_next_post_where', "WHERE post_date > '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID", $in_same_cat, $excluded_categories ); |
|---|
| 29 | < $sort = apply_filters( 'get_next_post_sort', 'ORDER BY post_date ASC LIMIT 1' ); |
|---|
| 30 | --- |
|---|
| 31 | > $where = apply_filters( 'get_next_post_where', "WHERE p.post_date > '$current_post_date' AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql AND p.ID != $post->ID", $in_same_cat, $excluded_categories ); |
|---|
| 32 | > $sort = apply_filters( 'get_next_post_sort', 'ORDER BY p.post_date ASC LIMIT 1' ); |
|---|
| 33 | 419c419 |
|---|
| 34 | < return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join $where $sort"); |
|---|
| 35 | --- |
|---|
| 36 | > return @$wpdb->get_row("SELECT p.ID, p.post_title FROM $wpdb->posts AS p $join $where $sort"); |
|---|