﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
13729,"Post Query should be able to order by specific order passed in ""post__in""",jakemgold,jakemgold,"Post queries can specify the posts to retrieve by passing an array of post IDs to the {{{post__in}}} parameter.

There is no built in method for sorting those posts by the order specified. In fact, I would argue that when using {{{post__in}}}, the post query should, by ''default'', order the posts in the same order specified in that array (I think this is the expected behavior by the developer).

Many custom themes allow the developer to specifically designate featured posts, controlling the order in which they appear. Many of these themes are forced to make independent queries for each post or execute an atypical loop by calling the result by ID (the post array's key). The ability to ""fetch"", properly order, and execute a standard loop for a specific set of posts in a specific order would reduce overhead and complexity in these situations.

I've developed a plug-in that does this as a workaround:

http://wordpress.org/extend/plugins/sort-query-by-post-in/

The 3.0+ specific code in there is *very* simple. It would be even more simple to do in base code (just another ""case"" in the orderby switch part of the query builder). In fact, I intend to submit a patch after 3.0 is released.

My plug-in provides the framework for the SQL to do this.",enhancement,closed,normal,3.5,Query,3.0,minor,fixed,has-patch needs-codex,
