[wp-hackers] Category Operation (Adjacency vs. Modified Preorder)

Chris Johnson agent_eight at hotmail.com
Sat Feb 11 18:15:33 GMT 2006


> I'm not sure that I see the sense in using modified preorder for WP 
> categories.
> It seems that the only thing we gain is the ability to count the number of 
> children any given node has.

The real draw that I see is the ability to create easily readable subtrees. 
You'ld have a dummy root node at the top of the tree and then a handful of 
subtrees as children. One for youre main blog entries, one for an aside, 
etc. You could include or exclude whole trees with single queries.

> However, it becomes significantly more
> difficult to loop through, say, the top level categories.

That's where the addition of a "level" field comes in. If your dummy root 
node is at level 0, just query all the children of root with level = 1. I 
think that's what you were looking for

I do admit this is a feature that does really need transactions to be safely 
viable. 


More information about the wp-hackers mailing list