Ticket #2415: prev_next_post hooks.diff
| File prev_next_post hooks.diff, 2.1 KB (added by , 20 years ago) |
|---|
-
C:/Xampp/htdocs/development/subversion/wordpress/wp-includes/template-functions-links.php
250 250 $join .= ')'; 251 251 } 252 252 253 $join = apply_filters('prev_next_post_join', $join); 254 $where = apply_filters('prev_next_post_where', ''); 255 253 256 $sql_exclude_cats = ''; 254 257 if ( !empty($excluded_categories) ) { 255 258 $blah = explode(' and ', $excluded_categories); … … 261 264 $posts_in_ex_cats_sql = 'AND ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; 262 265 } 263 266 264 return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join WHERE post_date < '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql ORDER BY post_date DESC LIMIT 1");267 return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join WHERE post_date < '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql $where ORDER BY post_date DESC LIMIT 1"); 265 268 } 266 269 267 270 function get_next_post($in_same_cat = false, $excluded_categories = '') { … … 282 285 } 283 286 $join .= ')'; 284 287 } 288 289 $join = apply_filters('prev_next_post_join', $join); 290 $where = apply_filters('prev_next_post_where', ''); 285 291 286 292 $sql_exclude_cats = ''; 287 293 if ( !empty($excluded_categories) ) { … … 296 302 297 303 $now = current_time('mysql'); 298 304 299 return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts $join WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID ORDER BY post_date ASC LIMIT 1");305 return @$wpdb->get_row("SELECT ID,post_title FROM $wpdb->posts $join WHERE post_date > '$current_post_date' AND post_date < '$now' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID $where ORDER BY post_date ASC LIMIT 1"); 300 306 } 301 307 302 308