Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#8650 closed defect (bug) (invalid)

WP_Query::get_posts needs a filter on the query_vars

Reported by: AaronCampbell Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: has-patch needs-testing
Focuses: Cc:


You can filter the WHERE string after it's been assembled by WP_Query::get_posts but you can't filter the query vars that are used to build that string BEFORE it's built. It would be REALLY nice to have that ability, so that a plugin could simply adjust the query vars and still let WP_Query::get_posts build the WHERE (JOIN, etc).

Attachments (2)

8650.001.diff (507 bytes) - added by AaronCampbell 11 years ago.
Adds 'query_vars' filter
8650.001.2.diff (429 bytes) - added by filosofo 11 years ago.
making it viewable

Download all attachments as: .zip

Change History (6)

11 years ago

Adds 'query_vars' filter

11 years ago

making it viewable

#1 @filosofo
11 years ago

What about 'parse_query'?

#2 @ryan
11 years ago

And 'query_string' for the main query.

#3 @ryan
11 years ago

There's already a query_vars filter in WP::parse_request(). That filters the vars for the main query. If you really need a filter within WP_query(), it needs to have a different name.

#4 @ryan
11 years ago

  • Milestone 2.7.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed

If the existing query_vars filter does not suffice, re-open with a patch that avoids name collision.

Note: See TracTickets for help on using tickets.