Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#13889 closed enhancement (duplicate)

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

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

Description

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.

thanks.

Attachments (1)

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

Download all attachments as: .zip

Change History (5)

#1 @dd32
16 years ago

  • Milestone Unassigned → Future Release
  • Owner set to dd32
  • Status new → 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) ​http://dd32.id.au/files/wordpress/example-hierarchical-term-links.php

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

#2 @kevinB
16 years ago

  • Cc kevinB added

#3 @epicalex
16 years ago

  • Cc epicalex added

#4 @nacin
16 years ago

  • Milestone Future Release
  • Resolution → duplicate
  • Status accepted → closed
Note: See TracTickets for help on using tickets.