WordPress.org

Make WordPress Core

Ticket #10717: adjacent_custom.patch

File adjacent_custom.patch, 984 bytes (added by prettyboymp, 5 years ago)
  • link-template.php

     
    898898        $order = $previous ? 'DESC' : 'ASC'; 
    899899 
    900900        $join  = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories ); 
    901         $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date), $in_same_cat, $excluded_categories ); 
     901        $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 ); 
    902902        $sort  = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 
    903903 
    904904        $query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort";