diff --git wp-includes/query.php wp-includes/query.php
index 0f394f0..fc1f135 100644
|
|
class WP_Query { |
2662 | 2662 | // Fetch sticky posts that weren't in the query results |
2663 | 2663 | if ( !empty($sticky_posts) ) { |
2664 | 2664 | $stickies__in = implode(',', array_map( 'absint', $sticky_posts )); |
2665 | | // honor post type(s) if not set to any |
2666 | | $stickies_where = ''; |
2667 | | if ( 'any' != $post_type && '' != $post_type ) { |
2668 | | if ( is_array( $post_type ) ) { |
2669 | | $post_types = join( "', '", $post_type ); |
2670 | | } else { |
2671 | | $post_types = $post_type; |
2672 | | } |
2673 | | $stickies_where = "AND $wpdb->posts.post_type IN ('" . $post_types . "')"; |
2674 | | } |
2675 | 2665 | |
2676 | | $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" ); |
| 2666 | $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts $join WHERE $wpdb->posts.ID IN ($stickies__in) $where" ); |
| 2667 | |
2677 | 2668 | foreach ( $stickies as $sticky_post ) { |
2678 | 2669 | // Ignore sticky posts the current user cannot read or are not published. |
2679 | 2670 | if ( 'publish' != $sticky_post->post_status ) |