[wp-hackers] Post/Page "Types"?

Mike Schinkel mikeschinkel at gmail.com
Sat Nov 1 11:10:11 GMT 2008

Peter Westwood wrote: 
>> You would need to provide admin pages and query extensions and template
extenstions though.

Thanks for the reply. 

Yes, admin pages would definitely be needed.

Currently I think that query_posts() supports a "post_type" query parameter,
right? What else would be needed there? 

And what kind of template extensions?  A "the_post_type()" template tag?
That would be easy.

That said, am I really the first to broach this issue?

-Mike Schinkel 
P.S. I just noticed posts of type "revision" in the wp_posts table. I'm not
familiar with how revision tracking works. How does WP find the current
version of a post if there were multiple revisions?  And would this cause
any problems with my concept of different post types?

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Peter Westwood
Sent: Saturday, November 01, 2008 6:36 AM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Post/Page "Types"?

Mike Schinkel wrote:
> Hi All:
> I've been working with Drupal for 1.5 years but was recently developed 
> some plugins for WordPress and came away liking WordPress an awful lot.
> Still there are some things Drupal does that WordPress doesn't do that 
> I need for future WordPress projects and I was wondering if anything 
> like this has been discussed in the past and/or if there is a plugin 
> I'm not familiar with that addresses this.
> First some background for those that don't know Drupal. In WordPress 
> you have the "wp_posts" where either "Posts", "Pages", or attachments 
> are stored (if I understand correctly.) In Drupal there is a table 
> analogous to "wp_posts" called "node" where all content is stored. In
Drupal "node"
> table's "type" field is similar to WordPress' "post_type" field in the 
> "wp_posts" table.  Yet unlike in WordPress where you have first-class 
> Posts or Pages, Drupal can have an infinite number of different 
> "content types" so that there are no "special" types in Drupal (even 
> though there are some default types like "Page" on installation.)
> Let's say I wanted to create a website listing companies like you 
> might find at http://crunchbase.com. In Drupal I'd use the CCK module 
> and create a new content type called "Company" and define the 
> additional fields I'd want for the company.  In addition I'd be able 
> to create a theme template that is specific to a node of type "company."
> It would be really useful if I could do something similar in 
> WordPress, for example say I could create a "company" post_type and store
in the "wp_posts"
> table but as a "company" and not as a "post" or "page" yet I'd still 
> be able to use features like categories and tags. Further I'd want to 
> define custom fields that would apply to just each company (like "CEO 
> name", "Phone Number", etc.) and then be able to create a theme 
> template that would apply to a company and a URL that would apply to a
> What are your thoughts on this?  Is anyone trying to address this with 
> any of the existing plugins and/or with future plans for WordPress.  
> Further, does it make any sense in future versions to genericize 
> posts/pages and allow a power user to configure them in the admin where
each "post type"
> would get configured to have a defined set of URLs, and logic like 
> "Uses Tags", "Uses Categories" etc?
> Thanks in advance for the help and discussion.
 From memory the table structures would allow this fine if you want to do it
in a plugin.

You would need to provide admin pages and query extensions and template
extenstions though.

Peter Westwood
http://blog.ftwr.co.uk | http://westi.wordpress.com C53C F8FC 8796 8508 88D6
C950 54F4 5DCD A834 01C5 

wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list