Make WordPress Core

Ticket #41924: patch.diff

File patch.diff, 1.1 KB (added by manchumahara, 7 years ago)

added a patch for the changes need

  • wp-includes/link-template.php

    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 
    17261726         *
    17271727         * @param string $order_by The `ORDER BY` clause in the SQL.
    17281728         * @param WP_Post $post    WP_Post object.
     1729         * @param string $order    ASC or DESC order in the SQL
    17291730         */
    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 );
    17311732
    17321733        $query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort";
    17331734        $query_key = 'adjacent_post_' . md5( $query );