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

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


>> But its all possible without too much hard effort, If you're aware of the
Internal API thats used.  

Thanks. A quick Google shows that several people have discussed it but
nobody's mentioned an actual implmentation:
http://www.google.com/search?q=wordpress+custom+post_type+plugin  If I get
somewhere with it I might even make it a module.

>> The PHPDoc in 2.7 should really help that..

BTW, I use PhpED debugger so if I want to know it bad enough and have the
time to explore I can usually figure out anything in the internals (I like a
debugger much better than a doc. :)

That said, how hard-coded is the "post" vs. "page" logic in the core?  For
example I remember fighting the code in /wp-includes/template-loader.php
because of the level to which it is hard-coded to assumptions. This would
need to be changed, no? 

And what about URL routing? I haven't looked at that so don't even know
where to start (I'm assuming that custom post_types would have their own URL
template.)

-Mike Schinkel 
http://mikeschinkel.com


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

On Sat, 01 Nov 2008 22:10:11 +1100, Mike Schinkel <mikeschinkel at gmail.com>
wrote:
> Currently I think that query_posts() supports a "post_type" query 
> parameter, right? What else would be needed there?

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

Theres a few plugins which use custom post_types i think, Cant think of one
off the top of my head though.

get_posts() / WP_Query supports the 'post_type' parameter, Thats what
differentiates it between using post/page/attachment/revision post_type's

Since the Taxonomy system is based on wp_posts.ID there shouldnt need to be
any changes there, But if you define a new taxonomy (rather than throwing
them in with the posts cat and tags) you'll probably need to define a few
new template functions which duplicate WP code..

But its all possible without too much hard effort, If you're aware of the
Internal API thats used. The PHPDoc in 2.7 should really help that..
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list