Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#13889 closed enhancement (duplicate)

permalinks for 'hierarchical' custom taxonomies do not behave hierarchically - is this correct?

Reported by: yeswework's profile yeswework Owned by: dd32's profile dd32
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:


with conventional Categories, the permalinks generated and recognised by WordPress reflect the true hierarchy – so you might have a parent category books, a subcategory fiction, a further subcategory novels, and so on, and a function like wp_list_categories would then generate the appropriate link /books/fiction/novels/ etc...

with custom taxonomies that have 'hierarchical = true', the behaviour is generally identical to Categories (eg. in the GUI). and yet the permalinks generated / accepted do not reflect the hierarchical structure – instead only one level appears to be accepted: either /books/fiction or /books/novels but not /books/fiction/novels etc...

I can't tell whether this is a bug or a feature, or understand why it would be different - nor could I find any reference to it after an extensive search. can anyone clarify?

the difference relates in part to the slightly different regular expressions for categories and custom taxonomies that turn up in rewrite rules, but I think it goes deeper than that, too.


Attachments (1)

hierarchical-term-links.php (1.5 KB) - added by dd32 14 years ago.

Download all attachments as: .zip

Change History (5)

#1 @dd32
14 years ago

  • Milestone changed from Unassigned to Future Release
  • Owner set to dd32
  • Status changed from new to accepted

for 3.0, Yes, this is the current behaviour.

I'm sure theres another ticket for this, however, cant seem to find it right now.

I'll take care of it in 3.1, setting to Future Release for now until patch is available.

For now, You can implement it yourself for a taxonomy, See this code for an example (replace 'state' with your own taxonomy in all cases obviously)

For future sake, I'm attaching a copy of the file

#2 @kevinB
14 years ago

  • Cc kevinB added

#3 @epicalex
14 years ago

  • Cc epicalex added

#4 @nacin
14 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.