[wp-hackers] WP Custom Post Type as 'Taxonomy' for Other Custom Post Type

Alex Andrews awgandrews at gmail.com
Thu Mar 24 09:51:41 UTC 2011


Dear all,

Got it now I think. Will try and blog it when I'm done to share the knowledge.

I am re-writing a plugin for managing a Creative Commons record label
I wrote ages ago with all my own custom SQL database records, and even
my own customised tags, title filters, RSS feeds, custom template
loader and post style loops and so on. Reviewing the code now, it is
incredible the lengths I went to in order to get things to work - it
feels weird when so much time went into it, but I am literally
blanking whole files to start from scratch. The plugin currently has
4,064 lines of code - I wonder how many it will have when I am done. I
am guess maybe a quarter of this.

Anyone interested in helping out to make the transition easy, then
great! Drop me an e-mail.

Wordpress is so impressive because you get so much "for free" when you
use the Custom Post API.

All the best,

Alex

On 24 March 2011 08:13, Lox <lox.dev at knc.nc> wrote:
> 2011/3/24 Otto <otto at ottodestruct.com>
>
>> It has nothing to do with how you register the post type. It has to do
>> with how you create the posts.
>>
>> Attachment posts work in the same way. The attachment post has a
>> post_type of "attachment" and the post_parent is set to the post where
>> the attachment was uploaded (which has a post type of "post" or
>> "page").
>>
>> When you do wp_insert_post to insert your custom post, you just set
>> the post_parent to the ID of the parent post item. Post type is
>> irrelevant to that.
>
>
> That post_parent use rocks.
>
> I personnaly use to use a custom metabox: when creating a new 'release' a
> custom metabox field allows to choose an artist (using a select box or an
> autocomplete text field) and I store the artist ID as a post meta.
>
> --
> Lox
> lox.dev at knc.nc
> _______________________________________________
> 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