Opened 13 years ago
Closed 10 years ago
#12719 closed enhancement (worksforme)
Custom taxonomy with query_var set, gets taxonomy query_var appended anyway
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description
In my browser address field, appending my WP url with "?customtax=termslug", the real WP query string gets changed to "?customtax=termslug&taxonomy=customtax&term=termslug".
This causes cases where I append two custom taxes in the URL to not work. E.g. "?customtax1=termslug1&customtax2=termslug2" would result in something like "?customtax1=termslug1&taxonomy=customtax1&term=termslug1&customtax2=termslug2" and not work.
If i two sets of custom taxonomies and slugs manually through a query_posts it works, and is not modified by WP.
Change History (9)
#1
@
13 years ago
- Milestone changed from Unassigned to 3.0
- Owner changed from ryan to dd32
- Status changed from new to accepted
#3
@
13 years ago
- Component changed from Canonical to Query
- Keywords reporter-feedback added; taxonomy query_vars removed
#4
@
13 years ago
It happens as you describe it - no redirection, just a change of the internal query vars. But only if i add "tax=term" in the URL and not in a query_posts in the theme/plugin.
I made a quick fix by unsetting $wp_query->querytaxonomy? and $wp_query->queryterm?, then running query_posts again.
My register_taxonomy()'s:
register_taxonomy( 'genre', array( 'udgivelser', 'koncerter', 'kunstnere' ), array( 'hierarchical' => false, 'label' => __('Tag: Genre'), 'query_var' => 'genre', 'rewrite' => false ) ); register_taxonomy( 'land', 'kunstnere', array( 'hierarchical' => false, 'label' => __('Tag: Land'), 'query_var' => 'land', 'rewrite' => false ) );
#5
@
13 years ago
- Keywords needs-patch added; reporter-feedback removed
- Milestone changed from 3.0 to 3.1
- Type changed from defect (bug) to enhancement
Ah, I see what i've done wrong. I only had one post with a colour attached.. The last taxonomy option provided wins over all others.
Sorry, You're right, Custom taxonomies dont support Intersections.
You can have an intersections between
- (multiple) Categories, (multiple) Tags
- (multiple) Categories, (multiple) Tags, and a Custom Taxonomy
But you cannot have
- Custom Taxonomy 1, Custom Taxonomy 2
I'm setting this to 3.1 as from what i can see, Its not supported yet, and as such, is an enhancement. There is another ticket around to add something similar (I think it was taxonomyin/taxonomynot_in and friends) but i cant find it right now.
Can you just verify the bug you're seeing?
Is WordPress -redirecting- you to the other URL you're mentioning? Or is this related to the Query Vars which are presented to WordPress?
Given the URL: http://localhost/wordpress/?state=nsw&colour=red I'm seeing NSW Posts which are also Red.
While WordPress is loading the page correctly, The Query vars do get messed up, For example:
The last added one is taking preference over the earlier ones.
From the description I thought this was a canonical redirection, but i cant seem to see that, I'm setting back to Query pending duplication.
Can you post up the register_taxonomy() calls which you're using to cause this? It might be dependent on a option you've got set.