WordPress 2.9: Custom Post Types Explained
WordPress 2.9 is ramping up support for custom post types. It's an improvement, but not nearly as exciting as you've probably been led to believe.
For starters, what is a custom post type in WordPress?
WordPress ships with 4 post types: post, page, revision, and attachment. WP uses a single table, called wp_posts, to store the bulk of its information. Within this table, there is a column called post_type. This column tells WordPress whether an item is a blog post, page, attachment, revision, etc. The idea behind "custom post types" is to add new post_type values (e.g. "event" or "publication"), and handle items differently depending on their post_type.

Custom Fields 101
If any data needs to get saved that doesn't belong in the wp_posts table, it can be saved using custom fields. Each custom field value is saved as a separate row in the wp_postmeta table.

What's new in WP 2.9?
get_post_type()
Returns the current item's post type (used within The Loop). This function is identical to $post->post_type.
get_post_types()
Returns an array of all post types.
register_post_type($post_type, $args_array)
Called from within a plugin or functions.php. Only 1 available argument: "exclude_from_search" Ex: $args_array = array('exclude_from_search' => true);
What to expect in the future
Currently, custom post types are all but useless without the help of plugins. For example, there is no code within WP core to auto-assign different fields for different post types. The ability to auto-create custom fields depending on the post type would make a lot of sense. There is talk of a UI being added for WP 3.0 to manage custom post types, but only time will tell.




