Make WordPress Core

Changeset 21776


Ignore:
Timestamp:
09/06/2012 07:01:21 PM (12 years ago)
Author:
markjaquith
Message:

Allow orderby=postin, which uses the explicit order you provided in the postin parameter. fixes #13729. props jakemgold, Otto42.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r21756 r21776  
    23322332        } elseif ( 'none' == $q['orderby'] ) {
    23332333            $orderby = '';
     2334        } elseif ( $q['orderby'] == 'post__in' && ! empty( $post__in ) ) {
     2335            $orderby = "FIELD( {$wpdb->posts}.ID, $post__in )";
    23342336        } else {
    23352337            // Used to filter values
Note: See TracChangeset for help on using the changeset viewer.