WordPress.org

Make WordPress Core

Changeset 12058


Ignore:
Timestamp:
10/19/09 16:31:20 (5 years ago)
Author:
ryan
Message:

Make get_adjacent_post work with custom post_types. Props prettyboymp. fixes #10717

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r11987 r12058  
    957957 
    958958    $join  = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories ); 
    959     $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 ); 
     959    $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 ); 
    960960    $sort  = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 
    961961 
Note: See TracChangeset for help on using the changeset viewer.