WordPress.org

Make WordPress Core

Ticket #13729: orderby post__in.diff

File orderby post__in.diff, 616 bytes (added by jakemgold, 3 years ago)

finally submitted a patch...

  • query.php

     
    23152315                        $orderby = "$wpdb->posts.post_date " . $q['order']; 
    23162316                } elseif ( 'none' == $q['orderby'] ) { 
    23172317                        $orderby = ''; 
     2318                } elseif ( $q['orderby'] == 'post__in' ) { 
     2319                        $orderby = empty( $post__in ) ? "$wpdb->posts.post_date " . $q['order'] : "find_in_set(ID, '" . $post__in . "')";  
    23182320                } else { 
    23192321                        // Used to filter values 
    23202322                        $allowed_keys = array('author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count');