WordPress.org

Make WordPress Core

Ticket #21970: 21970.patch

File 21970.patch, 808 bytes (added by SergeyBiryukov, 19 months ago)
  • wp-includes/post.php

     
    32993299        $in_string = "'". implode( "','", $parts ) . "'"; 
    33003300        $post_type_sql = $post_type; 
    33013301        $wpdb->escape_by_ref( $post_type_sql ); 
    3302         $pages = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type = '$post_type_sql' OR post_type = 'attachment')", OBJECT_K ); 
     3302        $pages = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type = '$post_type_sql' OR post_type = 'attachment') AND post_status != 'trash'", OBJECT_K ); 
    33033303 
    33043304        $revparts = array_reverse( $parts ); 
    33053305