Ticket #18613: 18613.2.patch
File 18613.2.patch, 1.2 KB (added by , 9 years ago) |
---|
-
wp-includes/link-template.php
1143 1143 $adjacent = $previous ? 'previous' : 'next'; 1144 1144 $op = $previous ? '<' : '>'; 1145 1145 $order = $previous ? 'DESC' : 'ASC'; 1146 $private_posts_cap_sql = get_private_posts_cap_sql( $post->post_type ); 1146 1147 1147 1148 $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 ); 1149 1150 $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 1150 1151 1151 1152 $query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort";