Opened 14 years ago
Closed 14 years ago
#16844 closed defect (bug) (fixed)
WP_Query::get_posts() pollutes the 'orderby' query var
Reported by: | scribu | Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Query | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
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'] ) && 'some_value' == $wp_query->query['orderby'] )
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
(In [17653]) Don't pollute orderby query var. Props scribu. fixes #16844