<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
		>
	<channel>
		<title>WordPress Ideas &#187; Topic: Allow Child Category To Have Multiple Parents</title>
		<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents</link>
		<description>WordPress Ideas &#187; Topic: Allow Child Category To Have Multiple Parents</description>
		<language>en-US</language>
		<pubDate>Fri, 24 May 2013 15:05:48 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="http://wordpress.org/ideas/rss/topic/allow-child-category-to-have-multiple-parents" rel="self" type="application/rss+xml" />

		<item>
			<title>Luke Gedeon on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents/page/2#post-23840</link>
			<pubDate>Wed, 12 Dec 2012 02:46:05 +0000</pubDate>
			<dc:creator>Luke Gedeon</dc:creator>
			<guid isPermaLink="false">23840@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Probably a couple months from a solution on this, but should not require any changes to core.
</p>]]></description>
					</item>
		<item>
			<title>dsdmdesign on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents/page/2#post-23839</link>
			<pubDate>Tue, 11 Dec 2012 23:09:10 +0000</pubDate>
			<dc:creator>dsdmdesign</dc:creator>
			<guid isPermaLink="false">23839@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>I'm trying to find a way to work around this issue with the tools I have. I'm creating a web magazine that will have various credits given to a custom taxonomy called "contributors". However, some of these contributors belong to multiple groups/organizations. I would like to be able to list these organizations as contributors, and add other contributors as children of all the organizations they belong to. Is there any way I can achieve this?
</p>]]></description>
					</item>
		<item>
			<title>Luke Gedeon on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-23166</link>
			<pubDate>Fri, 02 Nov 2012 18:47:36 +0000</pubDate>
			<dc:creator>Luke Gedeon</dc:creator>
			<guid isPermaLink="false">23166@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Even with a custom taxonomy the database index keyed on term_id-taxonomy does not allow multiple parents. Honestly all we need to do is change the key requirement on the wp_term_taxonomy table so that we can have multiple rows with the same term_id and taxonomy but different parent and then plugins can do their thing.
</p>]]></description>
					</item>
		<item>
			<title>Ipstenu (Mika Epstein) on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-23161</link>
			<pubDate>Wed, 31 Oct 2012 13:20:40 +0000</pubDate>
			<dc:creator>Ipstenu (Mika Epstein)</dc:creator>
			<guid isPermaLink="false">23161@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>There are also custom taxonomies. So you make one called Languages, and list them all there. You make another called EU and list the nations there.
</p>]]></description>
					</item>
		<item>
			<title>soultrader67 on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-23160</link>
			<pubDate>Wed, 31 Oct 2012 07:36:47 +0000</pubDate>
			<dc:creator>soultrader67</dc:creator>
			<guid isPermaLink="false">23160@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>The tag workaround is ok but as in life, sometimes there are more parents! Seriously though it does need a workaround other than tagging.
</p>]]></description>
					</item>
		<item>
			<title>Henry on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-23107</link>
			<pubDate>Mon, 22 Oct 2012 23:05:28 +0000</pubDate>
			<dc:creator>Henry</dc:creator>
			<guid isPermaLink="false">23107@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Has anyone given any thought to Binh's solution. I can't find fault with it. Nice approach
</p>]]></description>
					</item>
		<item>
			<title>Binh on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-18839</link>
			<pubDate>Sun, 27 Feb 2011 21:15:11 +0000</pubDate>
			<dc:creator>Binh</dc:creator>
			<guid isPermaLink="false">18839@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>I need this function as in Drupal.<br />
No it's not complecated. This is what I done in uni project, and is supposed very simple.</p>
<p>The following required fields already exist in wp_term_taxonomy</p>
<p>Term ID &#124; parent ID</p>
<p>So the tree is already complete. Now what you need is to allow duplicate term ID. That's for example:</p>
<p>Tax ID &#124; Term ID &#124; parent ID<br />
10 &#124; 30 &#124; 10<br />
11 &#124; 30 &#124; 13</p>
<p>That's for example<br />
Taxonomy number 10 is a record of Term 30 (T-Shirt), which is a child of Term 10 (Woman Clothing)<br />
Taxonomy number 11 is a record of Term 30 (T-Shirt), which is a child of Term 13 (Man Clothing)</p>
<p>No it's not complicated, it's just un-thought.</p>
<p>And for me, tagging sucks because there is no filter of Category vs Tag. And tag has no hierarchy, it SHOULD.
</p>]]></description>
					</item>
		<item>
			<title>Daljo628 on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-17206</link>
			<pubDate>Sat, 05 Jun 2010 13:51:01 +0000</pubDate>
			<dc:creator>Daljo628</dc:creator>
			<guid isPermaLink="false">17206@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Functionally, this is an impossibility due to the present native structure of the database.  I was hoping for feasability too, but I just found a workaround, based on how I structured my architecture.  I'd suggest using tags, instead.  Long story short, each category is a node in a <a href="http://en.wikipedia.org/wiki/Tree_(data_structure)">Tree Data Structure</a> with a pointer to its parent, but no pointers to children.  This is for simplicity and ease of use.  If they were to also store pointers to children, and modify the structure to permit multiple parents, the structure would become (I believe) exponentially more complicated, and hamper further development on more critical areas.</p>
<p>For the technical details of how WordPress stores Categories, read on ... for the sake of brevity and clarity, I'll omit a few columns from a few tables, that didn't seem relevant.</p>
<p>Categories are stored in the WordPress Database across three tables, <code>wp_terms</code> <code>wp_term_taxonomy</code> and <code>wp_term_relationships</code> iirc.  <code>wp_terms</code> stores a <code>term_id</code>, <code>term_name</code>, and <code>term_slug</code>.  <code>term_id</code> is auto-incrementing, so the code starts by shoving the name and slug into the <code>wp_terms</code> table, and then fetching the ID at which it was inserted.  Name doesn't have to be unique, but slug does!</p>
<p>Then we move onto the <code>wp_term_taxonomy</code> table.  As you may have noticed, we've been inserting words, but never saying what they meant!  The <code>wp_term_taxonomy</code> table stores <code>term_taxonomy_id</code>, <code>term_id</code>, <code>taxonomy</code>, <code>description</code>, <code>parent</code>, and <code>count</code>.  Now, <code>count</code> simply stores (for category purposes) the number of events that are assigned to that category, ignoring child-categories.  We can ignore it.</p>
<p><code>term_taxonomy_id</code> is the auto incrementing id that bumps up whenever you add in a new taxonomy.  <code>term_id</code> is the term in question from the <code>wp_terms</code> table.  Notice that this table has no slot for <code>name</code>.  It simply links into the <code>wp_terms</code> table, so you can have multiple term_taxonomies, pulling from the same name in <code>wp_terms</code>.  <code>taxonomy</code> is what the term is to be considered.  For our purposes, it will always be 'category'.  <code>description</code> is the description of the category, <strong>and <code>parent</code> is an INT, containing the parent category (that really cool thing that we care about).</strong></p>
<p><code>wp_term_relationships</code> is simply tying <code>wp_term_taxonomy</code> in with actual <code>object_id</code>s (posts, etc.)  It's the link between a post and its category, allowing you to create multiple entries, to link one post to multiple categories (because the link is stored seperately from either the parent or child).</p>
<p>Now, the significance of all this.  Categories are built as a tree data structure.  Each category is a very simple construct, storing a payload and a pointer -- the normal, lightest way to build trees.  Parents don't have pointers to their children, that could have to store anywhere from {no values} up to {thousands} or more.  Instead, each category just stores (data) (parent) and you can travel up and down the tree.  To travel to a parent, simply follow the pointer!  To travel back down, it becomes a bit more cumbersome, as you have to scan the entire table for any elements that have the parent assigned as a parent -- fortunately, an easy task with a MySQL database, simply querying <code>SELECT * FROM</code><code>wp_term_taxonomy</code> WHERE <code>parent</code> = '{$term_taxonomy}', where $term_taxonomy is the <code>term_taxonomy</code> of the parent in question!</p>
<p>Long story short, use tags, because a plugin would have to rewrite the whole system, which is possible, but not very cost-effective!
</p>]]></description>
					</item>
		<item>
			<title>Mark on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-16716</link>
			<pubDate>Tue, 13 Apr 2010 10:22:50 +0000</pubDate>
			<dc:creator>Mark</dc:creator>
			<guid isPermaLink="false">16716@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Taxonomy intersection like this can already be done by using a combination of Categories and Tags (the latter being orthogonal to category organization. A plugin to smooth this process would be good, but I don't think the core needs changing for this.
</p>]]></description>
					</item>
		<item>
			<title>Jen Mylo on "Allow Child Category To Have Multiple Parents"</title>
			<link>http://wordpress.org/ideas/topic/allow-child-category-to-have-multiple-parents#post-16689</link>
			<pubDate>Sun, 11 Apr 2010 19:50:57 +0000</pubDate>
			<dc:creator>Jen Mylo</dc:creator>
			<guid isPermaLink="false">16689@http://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>I think this is probably plugin territory right now.
</p>]]></description>
					</item>

	</channel>
</rss>
