Changeset 12143
- Timestamp:
- 11/05/2009 03:52:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r12127 r12143 2349 2349 if ( !empty($sticky_posts) ) { 2350 2350 $stickies__in = implode(',', array_map( 'absint', $sticky_posts )); 2351 $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in)" ); 2351 // honor post type(s) if not set to any 2352 $stickies_where = ''; 2353 if ( 'any' != $post_type && '' != $post_type ) { 2354 if ( is_array( $post_type ) ) { 2355 $post_types = join( "', '", $post_type ); 2356 } else { 2357 $post_types = $post_type; 2358 } 2359 $stickies_where = "AND $wpdb->posts.post_type IN ('" . $post_types . "')"; 2360 } 2361 $stickies = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.ID IN ($stickies__in) $stickies_where" ); 2352 2362 /** @todo Make sure post is published or viewable by the current user */ 2353 2363 foreach ( $stickies as $sticky_post ) {
Note: See TracChangeset
for help on using the changeset viewer.