From 48737c2246a5c420601dde4ecaa908f311ec41c9 Mon Sep 17 00:00:00 2001
From: Sabuj Kundu <sabuj@codeboxr.com>
Date: Wed, 20 Sep 2017 14:06:15 +0600
Subject: [PATCH] added $order parameter to get adjacent sort order sql filter
---
wp-includes/link-template.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index f16b8f58df..84e6c42a19 100644
a
|
b
|
function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo |
1726 | 1726 | * |
1727 | 1727 | * @param string $order_by The `ORDER BY` clause in the SQL. |
1728 | 1728 | * @param WP_Post $post WP_Post object. |
| 1729 | * @param string $order ASC or DESC order in the SQL |
1729 | 1730 | */ |
1730 | | $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post ); |
| 1731 | $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post, $order ); |
1731 | 1732 | |
1732 | 1733 | $query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort"; |
1733 | 1734 | $query_key = 'adjacent_post_' . md5( $query ); |