Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#16844 closed defect (bug)

WP_Query::get_posts() pollutes the 'orderby' query var — at Initial Version

Reported by: scribu Owned by:
Milestone: 3.2 Priority: normal
Severity: normal Version:
Component: Query Keywords: has-patch
Focuses: Cc:


After running through get_posts(), the 'orderby' query var no longer contains the original value, but the final SQL code.

Thus, instead of:

if ('some_value' == $wp_query->get( 'orderby' ) ) {

you have to do:

if ( isset( $wp_query->query['orderby'] ) && 'qa_score' == $wp_query->query['orderby'] ) {

Change History (1)

7 years ago

Note: See TracTickets for help on using tickets.