Make WordPress Core

Opened 13 years ago

Last modified 5 years ago

#20386 new defect (bug)

Year permalinks "win" against category permalinks

Reported by: markjaquith's profile markjaquith Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Canonical Keywords: needs-patch needs-unit-tests
Focuses: Cc:

Description

We need to decide whether category permalinks should take priority over year permalinks.

e.g. /2008/?category_name=cat-a

Should that stay the same, or redirect to:

/category/cat-a/?year=2008

We have a unit test which is failing.

Attachments (1)

20386-tests.patch (929 bytes) - added by boonebgorges 10 years ago.
Removing from trunk as per #30284

Download all attachments as: .zip

Change History (7)

#1 @nacin
13 years ago

We've had somewhat similar prioritization issues where this has come up for post types versus taxonomies.

I think it should go like this: post types > taxonomies > date filters.

#2 @duck_
13 years ago

Similarly with the author_name vs. year query variables, see #17661. We should take one of these tickets and define the priority of all query variables.

Also related: #18385.

#3 @scribu
13 years ago

Agree that date filters should have the lowest priority.

#4 @wonderboymusic
12 years ago

IMO, canonical URL should always win over query string, and both always win over tax_query.

I addressed the problem with tax_query winning here: #20767

Right now, tax is beating tag and category, which to me makes no sense because tax_query is a sub-request. Query string terms get tax=term treatment in WP_Query but are really only altering context of the request, not completely changing it.

Precedence really only affects theme functions since is_year, is_category will both be true and the year and category are publicly available in the request. Whoever "wins" gets precedence in which template is picked or which title is displayed, etc.

Last edited 12 years ago by SergeyBiryukov (previous) (diff)

@boonebgorges
10 years ago

Removing from trunk as per #30284

#5 @chriscct7
9 years ago

  • Keywords needs-patch added

#6 @johnbillion
9 years ago

  • Keywords needs-unit-tests added
Note: See TracTickets for help on using tickets.