WordPress.org

Make WordPress Core

Ticket #18613: 18613.2.patch

File 18613.2.patch, 1.2 KB (added by SergeyBiryukov, 3 years ago)
  • wp-includes/link-template.php

     
    11431143        $adjacent = $previous ? 'previous' : 'next'; 
    11441144        $op = $previous ? '<' : '>'; 
    11451145        $order = $previous ? 'DESC' : 'ASC'; 
     1146        $private_posts_cap_sql = get_private_posts_cap_sql( $post->post_type ); 
    11461147 
    11471148        $join  = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories ); 
    1148         $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 ); 
     1149        $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = %s AND $private_posts_cap_sql $posts_in_ex_cats_sql", $current_post_date, $post->post_type), $in_same_cat, $excluded_categories ); 
    11491150        $sort  = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 
    11501151 
    11511152        $query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort";