Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10208 closed enhancement (invalid)

custom taxonomy realtionship

Reported by: F J Kaiser Owned by: filosofo
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: close taxonomy, tag, relationship, non-hierarchical
Focuses: Cc:


I´ve got no sollution for this. Just wanted to start a discussion to find one.

There´s still no possibility to make relationships between custom taxonomies. For e.g. If i got a tag named "Hans" and two taxonomies named "friends" and "colleagues at work" i can´t add "Hans" to both. Instead i have to add the tag "Hans" to "friend" & "colleagues at work". If i now want to add the tag to post belonging to "Hans" i would end with two tags named both "Hans" to get the post in both taxonomies.

Change History (10)

comment:1 @F J Kaiser6 years ago

  • Keywords taxonomy tag relationship non-hierarchical added


comment:2 @Denis-de-Bernardy6 years ago

  • Keywords close added
  • Milestone changed from Unassigned to Future Release

Seems invalid.

Consider Joe, only a friend, and Bruce, a colleague you don't like. There is no clear relation between those taxonomies. They're different animals and adding Hans to both friends and colleagues is the correct thing to do.

Consider two other taxonomies and a trickier example: user roles, and user caps. Roles imply caps, as do users. And you'd want to override a roles caps if needed. (A true|false might become needed, as would an expires field if you want to temporarily assign a role or a cap.) The key question is whether role implies caps should be managed in the db or in php. If the former, we need a taxonomy that applies to taxonomies. It seems possible already.

comment:3 @F J Kaiser6 years ago

How would you add the term "Hans" to both taxonomies? The admin-UI offers only the possibility to add one term to one taxonomy. So would have two terms named "Hans" in both taxonomies, which stand in no relation to each other. They only got the same name. If you would list all terms from all taxonomies, you would get "Hans" 2 times. See my question, Denis?

comment:4 @Denis-de-Bernardy6 years ago

Mm, actually, you'd have one line in terms, and two lines in term_taxonomy. As is done with tags and categories (and link categories, for that matter).

comment:5 @F J Kaiser6 years ago

sorry, i think my english & wp-skills are not good enough at this point. Could you try to explain further what you mean with "one line/two lines in term/term_taxonomy"? Thanks.

comment:6 @dd326 years ago

The current taxonomy system does not do what you want.

The taxonomy system works a bit like this:

  • We have Taxonomies, These are separate classes of Terms, Think of a taxonomy as a class room
  • We have Terms, These are members of a Taxonomy, Think of Terms as children

Children can only exist in one Classroom at a time, Same for Terms, They're a Term of a Taxonomy, No overlap between each other.

You could manipulate the database at SQL level like Denis is suggesting, However that would not achieve your goal either. As you'd still have a term appearing twice in the UI.

I dont think theres any real solution to what you're asking, Its pretty impossible with the way you're invisioning it.

If i was to attempt to do it the way you are, i'd have 2 sets:

  • A Taxonomy, "People" with "Persons" as terms of it.
  • A Taxonomy, "People Categories" - Which has no linkin to People.
  • A custom table, or something, which lets you look up all the "People categories" which a "Person" belongs to, Throw in some custom Template PHP to tie it all together.

So as you can see, Its not possible the way you're approaching it, And i dont think its something that'll ever be available in WP in the short term - I'd suggest closing as wontfix, as its a functionality which doesnt make sense to provide in the taxonomy system right now.

comment:7 @F J Kaiser6 years ago

first: thanks for discussing this.

  • i got "tags" to mark/indicate posts
  • - a "tag" describes some part of the content of a post
  • i got "categories" to group posts
  • - a "category" describes which sort of post it is

now i got every thing i need to manage my posts. the only problem is, that i will always have to search through all categories or all tags.

i understood the whole concept not in doubling categories and tags and sticking them together in single groups to call them "taxonomies". i always thought what we would get was a possibilitie to group "tags" within "categories". if i could use "taxonomies" as a link between "tags" and my posts, everything would be fine and we would´ve got a lot of additional possibilities to make indicating posts more effectifly and making searching for posts even faster and more wiki-like.

i would see a possible sollution in splitting between "terms" and "taxonomies". instead of using one screen for each taxonomy, using a single screen to create and add "terms" to "taxonomies". (if you got 100+ "taxonomies" i want to see your admin-menu;).

i´d suggest to let the milestone with future release.

comment:8 @Denis-de-Bernardy6 years ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

Well, closing this as invalid/dup/wontfix. Please follow the couple of other tickets, in the taxonomy component, that relate to changing the way the taxonomy data work. There are quite a few already (#5034, #6211, etc.).

comment:9 @dd326 years ago

F J Kaiser: Well, Yes, You could add Tags of categories, Theres nothing in the taxonomy system which prevents a Taxonomy describing another taxonomy, Its just that its not implemented in core..

I guess most people however, would not have 100 taxonomies to start with :) And only Taxonomies which describe posts/pages/links/media should show up on the menu's anyway..

comment:10 @F J Kaiser6 years ago

Note: i know this is no support-forum, so we could switch over to wordpress.org. > idea?

I tried to add custom taxonomies for pages and links, but found nothing working. And i wouldn´t know how to add tags to taxonomies...

Note: See TracTickets for help on using tickets.