WordPress.org

Make WordPress Core

Ticket #24597: 24597.1.diff

File 24597.1.diff, 1.3 KB (added by JustinSainton, 9 months ago)
  • wp-includes/link-template.php

     
    11731173        $op = $previous ? '<' : '>'; 
    11741174        $order = $previous ? 'DESC' : 'ASC'; 
    11751175 
    1176         $join  = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories ); 
    1177         $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' $posts_in_ex_cats_sql", $current_post_date, $post->post_type), $in_same_cat, $excluded_categories ); 
    1178         $sort  = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 
     1176        $join  = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories, $post ); 
     1177        $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' $posts_in_ex_cats_sql", $current_post_date, $post->post_type), $in_same_cat, $excluded_categories, $post ); 
     1178        $sort  = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post ); 
    11791179 
    11801180        $query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort"; 
    11811181        $query_key = 'adjacent_post_' . md5($query);