WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#7755 closed defect (bug) (wontfix)

Query post like p=xxx?cat=zzz

Reported by: arena Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: wp_query
Focuses: Cc:
PR Number:

Description

the post is retrieved with a query_post which is p=xxx?cat=zzz

the issue is that WordPress retrieves the post xxx even if the post is not in the category zzz ....

Could it be a WP bug ?

Change History (5)

#1 @jacobsantos
11 years ago

No. Most likely WordPress thinks you're doing it wrong and correcting it for you. It is a feature to prevent id ten t errors.

#2 @jacobsantos
11 years ago

  • Keywords wp_query added

#3 @jacobsantos
11 years ago

  • Milestone changed from 2.7 to 2.8

No patch, not confirmed.

#4 @jacobsantos
11 years ago

  • Priority changed from high to normal
  • Severity changed from major to normal

#5 @DD32
11 years ago

  • Milestone 2.8 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I'm going to close this as a wontfix, AFAIK, WordPress takes the highest ranking information it can in order to retrieve the post, If the ID is presented, it dives straight to that ID, much less work than doing a SQL Join to determine the category's posts, and then matching against the ID.

And given that WordPress should never generate that URL itself, does it need to be taken into account?

Some modifications to the canonical redirect code could be implemented to redirect queries like that to ?p=xx though possibly.

Note: See TracTickets for help on using tickets.