[wp-hackers] Custom Post Types and pending incompatibilities

Rich Pedley elfin at elfden.co.uk
Mon Jul 12 22:24:49 UTC 2010

On 12/07/2010 21:24, Peter Westwood wrote:
> I've read through the whole thread and he are my comments.
> Personally I would recommend against people "reserving" post types
> - you are creating mines in which your data will be stored which
> won't make it easy for other plugins or themes to interact with
> without breaking arbitrary rules:
> "like custom post types must be prefixed in a plugin specific way"
> I would rather recommend that if you are creating a plugin which
> allows people to create "Events" you use a post type called "event"
> and you write your code in such a way that if some special piece of
> post_meta you need is missing you have a default for it which you
> use.
> That way when I decide to switch from your Events plugin to this
> new kid on the block I can still manage and use all those events I
> already created using the new plugin.

I cringe whenever I read people saying this. Maybe my thinking is 
wonky on this issue, but surely different plugins will have different 
ideas on how to use things. Example: 2 plugins each using 'event' as 
their custom post type.
plugin one uses start_date & end_date
plugin two uses startdate & enddate

(and yes I'm thinking specifically of post meta here).

You stop using plugin one and go to plugin two - but you will 
potentially lose any extra data stored. The only commonality is the 
post type name - every thing else is potentially different.

Yes the post itself remains, but all the extras won't. I'm not sure I 
see the benefit of actually using the same custom post type.

So am I missing something here?


More information about the wp-hackers mailing list