[wp-trac] [WordPress Trac] #29424: Query argument 'orderby' makes duplicated parameters possible (was: [WP 4.0] - orderby duplicated paramaters possible)

WordPress Trac noreply at wordpress.org
Fri Aug 29 11:32:15 UTC 2014


#29424: Query argument 'orderby' makes duplicated parameters possible
--------------------------+------------------------------
 Reporter:  ChriCo        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by ocean90):

 * version:   => trunk


Old description:

> In your newest post in [make-
> blog](http://make.wordpress.org/core/2014/08/29/a-more-powerful-order-by-
> in-wordpress-4-0/) there a serveral errors in code.
>
> 1. Duplicated parameters are possible. Following Code will output the
> "error":
>
> {{{
>
> $query = new WP_Query( array( 'orderby' => array( 'title' => 'DESC',
> 'post_title' => 'ASC' ) ) );
>
> //ouputs: ORDER BY post_title DESC, post_title ASC
> }}}
>
> 2. Why is
>
> * "title" equal to "post_title"
> * "name" to "post_name"
> * "author" to "post_author"
>
> and so on?
>
> 3. By the way, "date_gmt", "post_status", "modifed_gmt",
> "content_filtered", "mime_type", "type" are missing...
>
> 4. there are some columns missing in "orderby".

New description:

 In your newest post in [http://make.wordpress.org/core/2014/08/29/a-more-
 powerful-order-by-in-wordpress-4-0/ make-blog] there a serveral errors in
 code.

 1. Duplicated parameters are possible. Following Code will output the
 "error":

 {{{

 $query = new WP_Query( array( 'orderby' => array( 'title' => 'DESC',
 'post_title' => 'ASC' ) ) );

 //ouputs: ORDER BY post_title DESC, post_title ASC
 }}}

 2. Why is

 * "title" equal to "post_title"
 * "name" to "post_name"
 * "author" to "post_author"

 and so on?

 3. By the way, "date_gmt", "post_status", "modifed_gmt",
 "content_filtered", "mime_type", "type" are missing...

 4. there are some columns missing in "orderby".

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29424#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list