Make WordPress Core

Opened 13 years ago

Last modified 4 years ago

#23862 reopened defect (bug)

Clean up old WP->public_query_vars and WP->private_query_vars

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

Description

There are some old non-working public_query_vars still in the WP class that should be cleaned up.

Also, since 'post_type' is now a public_query_var, it can be removed from the private_query_vars.

Attachments (1)

23862.diff (2.1 KB ) - added by prettyboymp 13 years ago.

Download all attachments as: .zip

Change History (15)

@prettyboymp
13 years ago

#1 @prettyboymp
13 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
13 years ago

  • Milestone Awaiting Review3.6

#3 @alex-ye
13 years ago

  • Cc nashwan.doaqan@… added

#4 @ryan
13 years ago

  • Milestone 3.6Future Release

#5 @nacin
13 years ago

  • Component GeneralQuery

#6 @nacin
13 years ago

  • Milestone Future Release3.9

#7 @nacin
13 years ago

Keep in mind it may be worth holding onto some of these as reserved terms for future use, like search.

#8 @nacin
12 years ago

I don't care much about static, pb, or even calendar, but I think it'd make sense for search and posts to remain reserved. (I wonder what pb was for.)

Going to clean up post_type and leave the others alone for now.

#9 @nacin
12 years ago

  • Owner set to nacin
  • Resolutionfixed
  • Status newclosed

In 27738:

WP class: Remove duplication of the post_type query var, also specified as a public QV.

props prettyboymp.
fixes #23862.

#10 @nacin
12 years ago

  • Milestone 3.9Future Release
  • Resolution fixed
  • Status closedreopened

Alright, this actually broke a canonical unit test. (The noRewrite ?post_type=fake-cpt&p=1 one.)

WP::parse_request() parses public query vars and then parses private query vars. But in between there, it discards any post types that aren't publicly queryable. The canonical tests leverage WP::main() directly, and thus private query vars have outsized influence... It's kinda tough to explain, and was not fun to track down.

Anyway, as this was ostensibly for cleanup, and it clearly causes some side effects, I'm reverting.

#11 @nacin
12 years ago

In 27768:

Revert [27738] as the patient exhibited side effects. see #23862.

#12 @nacin
12 years ago

#27549 and #27547 — this definitely breaks things, in this case the admin which uses wp() and thus private query variables directly.

So at least for the post_type query variable, which is a particularly special case in the WP class, it's *not* invalid for it to be listed in public *and* private query variables.

#13 @chriscct7
11 years ago

  • Severity trivialnormal

This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.


4 years ago

Note: See TracTickets for help on using tickets.