[wp-hackers] Is there any compelling reason to use a custom post type plugin?

Dion Hulse (dd32) wordpress at dd32.id.au
Sat Jul 24 03:47:13 UTC 2010


On Sat, 24 Jul 2010 12:13:54 +1000, Angelia Baladon  
<angelia at 10sexyapples.com> wrote:
> #1 - Allow the plugin to be disabled without losing the terms
> associated with the taxonomies. This should be an option. Should the
> plugin not stay up to date or just not be supported any more, the site
> administrator should be able to disable it, and enable another. In
> that new plugin ( or in their functions file ), they should be able to
> register their post types and taxonomies again, or perhaps even have a
> way to de-register without erasing, and re-register a post type, and
> taxonomies, so that when they are re-registerd all of the terms and
> relations are in tact. I know that I had a problem with this when I
> was first testing the plugin I went with, where a revision existed in
> the database with a custom post type attached from my hand coded
> version, and therefore I could not register the post type with the
> plugin.

Just like to mention here, If a plugin is deleting custom post_type DATA  
or taxonomy TERMS upon deactivation thats a bad thing.
However, Once the plugin is deactivated, the registration calls are  
terminated, As a result, WordPress no longer knows about the posts in the  
table, or the terms.

If you simply register a new post_type of the same name in code, and the  
taxonomies, WordPress should "link" everything together again (Or rather,  
just enable the admin UI/front end UI for them, since the data was never  
"lost")

> #2 - Do not wrap the registration functions in classes in such a way
> that the site administrator cannot interact with their custom post
> types and taxonomies via core code hooks and filters, outside of your
> plugin ... i.e. if your plugin code is registering my custom
> taxonomies, and I need to add in
> register_taxonomy_for_object_type('art', 'link'); because it is not in
> your code, don't make that an impossibility for me. Otherwise, an
> awful lot of people are going to be hitting dead ends in the future,
> as this great new functionality evolves, and they are locked into code
> like this that controls such an important aspect of their site.

This is a great reason why "developer" plugins SHOULD include plenty of  
do_action('myplugin_after_initposttypes'); sort of calls, to allow other  
developers to take advantage of such functionality.


One of the things i'd like to mention here however, Is that plugins are  
often written to fufil a simple task, in this case, the plugin is designed  
to simply register the post type, and taxonomy, Its not designed to be  
highly customisable and be able to be morphed into every possible  
use-case, Its probably designed for power users who want to add a post  
type, but -cant- write the code to achieve it.



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