diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-11 15:57:00 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-11 15:57:00 +0000 |
commit | e4426def6d30d301a3f2eb8f7270345d9781edfe (patch) | |
tree | e881e449092e7f1617cad3d89e0a7a3878641fb3 /wp-includes/link-template.php | |
parent | a35bb9df8c7816a6facf68ff963d5350999befe4 (diff) | |
download | wordpress-mu-e4426def6d30d301a3f2eb8f7270345d9781edfe.tar.gz wordpress-mu-e4426def6d30d301a3f2eb8f7270345d9781edfe.tar.xz wordpress-mu-e4426def6d30d301a3f2eb8f7270345d9781edfe.zip |
WP Merge to rev 4721
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@840 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/link-template.php')
-rw-r--r-- | wp-includes/link-template.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index ef570f2..20b9132 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -296,7 +296,11 @@ function get_previous_post($in_same_cat = false, $excluded_categories = '') { $posts_in_ex_cats_sql = 'AND ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; } - 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"); + $join = apply_filters( 'get_previous_post_join', $join, $in_same_cat, $excluded_categories ); + $where = apply_filters( 'get_previous_post_where', "WHERE post_date < '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql", $in_same_cat, $excluded_categories ); + $sort = apply_filters( 'get_previous_post_sort', 'ORDER BY post_date DESC LIMIT 1' ); + + return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join $where $sort"); } function get_next_post($in_same_cat = false, $excluded_categories = '') { @@ -329,7 +333,11 @@ function get_next_post($in_same_cat = false, $excluded_categories = '') { $posts_in_ex_cats_sql = 'AND ID NOT IN (' . implode($posts_in_ex_cats, ',') . ')'; } - 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 AND ID != $post->ID ORDER BY post_date ASC LIMIT 1"); + $join = apply_filters( 'get_next_post_join', $join, $in_same_cat, $excluded_categories ); + $where = apply_filters( 'get_next_post_where', "WHERE post_date > '$current_post_date' AND post_type = 'post' AND post_status = 'publish' $posts_in_ex_cats_sql AND ID != $post->ID", $in_same_cat, $excluded_categories ); + $sort = apply_filters( 'get_next_post_sort', 'ORDER BY post_date ASC LIMIT 1' ); + + return @$wpdb->get_row("SELECT ID, post_title FROM $wpdb->posts $join $where $sort"); } |