Make WordPress Core

Ticket #13729: orderby post__in.2.diff

File orderby post__in.2.diff, 613 bytes (added by jakemgold, 13 years ago)

less is more with code changes...

  • wp-includes/query.php

     
    23152315                        $orderby = "$wpdb->posts.post_date " . $q['order'];
    23162316                } elseif ( 'none' == $q['orderby'] ) {
    23172317                        $orderby = '';
     2318                } elseif ( $q['orderby'] == 'post__in' && ! empty( $post__in ) ) {
     2319                        $orderby = "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');