[wp-hackers] Some Thoughts/Enhancement Ideas In AndAroundTheCategory Side Of Things

Dion Hulse (dd32) wordpress at dd32.id.au
Sun Feb 14 03:30:57 UTC 2010


On Sun, 14 Feb 2010 13:32:55 +1100, Mark McWilliams <admin at wpkid.com>  
wrote:

> From: "Charles Frees-Melvin" <charles at cefm.ca> Thursday, Feb 11, 2010
>> It would however interfere with the slugs of pages and could create
>> conflicts. As currently there is top level taxonomy for pages. It   
>> really
>> could hurt the pages functionality if there was no taxonomy for
>> categories.
>
> Fair enough, I know when WP was being created they most likely never  
> thought
> about Custom Taxonomies, let alone any of the finer details with regards  
> to
> the rewrite rules it now has in place, but, (unless I missed something)
> what's wrong with something like...?
>
> http://www.site.com/contact/ - Which will be a page!
>
> /?post=hello-world
> /?page=contact
> /?taxonomy=people
>
> http://www.site.com/hello-world/ - That'll be the post URL!
>
> /?post=hello-world
> /?page=contact
> /?taxonomy=people
>
> http://www.site.com/people/ - And oddly enough, we have the custom  
> taxonomy!
>
> /?post=hello-world
> /?page=contact
> /?taxonomy=people
>
> So in theory, what it'll do is search between a POST, PAGE and TAXONOMY  
> for
> a match! =)
>
> Have I just completely missed the point, or what, to me that looks pretty
> simple!

It looks pretty simple from the top, But once you get into it, Its a bit  
more complex than that.
WordPress is dynamic, All URL's are dynamically generated, they're not  
stored anywhere.

WordPress parses the request using the permastructure and determines  
you're looking for a post in 2010 with the slug 'hello-world'
WordPress parses the request and see's you're looking for '/contact', Its  
assumed thats a page.

How do you differentiate between 'Contact', 'Contact' and 'Contact'? That  
is, Post, Page, Taxonomy Term.

It all comes down to Performance, I can quite easily search through 10  
items manualy and give you it within a decent ammount of time, A computer  
can do it faster.
What a computer cannot do, or at least, not shared hosts, is given  
thousands of objects, and you ask for 'hello-world' locate it quickly,  
Telling it its a post|page|category narrows it down significantly, Give it  
a date, and it'll have it even quicker.

There is NOTHING stoping a plugin at present from completely overriding  
the Query/Rewrite/Link Storage mechanisms that i'm aware of, It would take  
probably less than 20 LOC to hook WordPress, the rest would be your custom  
handling. I'm pretty sure there exists plugins which do exactly this (But  
i have none on hand).


-- 
Dion Hulse / dd32

Contact:
  e: contact at dd32.id.au
  msn: msn at d32.id.au
  skype: theonly_dd32
  Web: http://dd32.id.au/


More information about the wp-hackers mailing list