[wp-hackers] Custom Post Types and pending incompatibilities

Andrew Nacin wp at andrewnacin.com
Mon Jul 12 20:31:29 UTC 2010


On Mon, Jul 12, 2010 at 4:24 PM, Peter Westwood
<peter.westwood at ftwr.co.uk>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.
>
> Basically a plugin using Custom Post Types should follow Postel's Law:
>
> "be conservative in what you do, be liberal in what you accept from others"
>
> I think that it is better for the community and the users in general if it
> is easy for people to switch between plugins which compete in the same space
> rather than difficult because they have stored the data slightly differently
> after all this is why we have custom post types instead of each plugin
> creating it's own tables.
>

To take what Peter said a little further, just some additional food for
thought:

I don't want my products/books/events to be wiped on an uninstall hook, as I
worked hard to cultivate that data.


More information about the wp-hackers mailing list