WordPress.org

Make WordPress Core

Ticket #28026: refresh.28026.diff

File refresh.28026.diff, 1.0 KB (added by lektro, 5 years ago)

Refresh of initial patch

  • src/wp-includes/link-template.php

    diff --git src/wp-includes/link-template.php src/wp-includes/link-template.php
    index 97a5990..2dc8411 100644
    function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previo 
    15471547         * @param bool   $in_same_term   Whether post should be in a same taxonomy term.
    15481548         * @param array  $excluded_terms Array of excluded term IDs.
    15491549         */
    1550         $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = 'publish' $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms );
     1550        $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE ( p.post_date $op %s OR ( p.post_date = %s AND p.ID $op %d ) ) AND p.post_type = %s AND p.post_status = 'publish' $where", $current_post_date, $current_post_date, $post->ID, $post->post_type ), $in_same_term, $excluded_terms );
    15511551
    15521552        /**
    15531553         * Filter the ORDER BY clause in the SQL for an adjacent post query.