From 5891de345527eade4b131232f217d2feddd4d06e Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 19 Oct 2009 16:31:20 +0000 Subject: [PATCH] Make get_adjacent_post work with custom post_types. Props prettyboymp. fixes #10717 git-svn-id: http://svn.automattic.com/wordpress/trunk@12058 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 268cbed74..b0331da14 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -956,7 +956,7 @@ function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $pre $order = $previous ? 'DESC' : 'ASC'; $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories ); - $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 ); + $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 ); $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); $query = "SELECT p.* FROM $wpdb->posts AS p $join $where $sort";