[wp-trac] [WordPress Trac] #9228: query_posts orderby=category uses posts post_category field instead of terms table

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 24 23:50:34 GMT 2009


#9228: query_posts orderby=category uses posts post_category field instead of
terms table
--------------------------+-------------------------------------------------
 Reporter:  MichaelH      |       Owner:  anonymous 
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Template      |     Version:  2.7.1     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 The query_posts 'orderby=category' still uses the posts table field
 'post_category' instead of terms table.

 This query:
  <?php query_posts('showposts=-1&orderby=category&order=DESC'); ?>

 generates this MySQL SELECT statement:
  SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type =
 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status =
 'private')  ORDER BY wp_posts.post_category DESC

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9228>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list