Select post parent from another post type in WordPress

Added 2016/02/05: There's a newer version of this post with very detailed steps to show you how to set the URL structure for this use case right.

This gist is kinda of my inspiration to create Completely Delete. Last year a client project need to cross reference 2 different post types. When I do some research on Google, a post from My Musings describe how to change the parent select options to posts from another post type. This is quite useful and a time saver for me.

After the cross reference work had been done, the client found another issue that when he trash or delete the parent post, the child posts won’t be trashed / deleted with it.

Few months later when I planed to develop my first plugin for the new business – 1Fix.io, I decided to fix this issue as a start point.

I’m a senior web developer helping clients build their websites to grow businesses. Currently I’m based in Taipei, Taiwan.

I write things about WordPress, AngularJS and life. Whenever you’d like to find someone to talk about these topics, just get in touch!

  • Hi,

    I have managed to add the meta box to link across 2 different custom post types. Unfortunately though the child post single now only shows the 404 page or with some tweaks to the register of the custom post type it shows the default posts type.

    Can you suggest anything?

    Regards,

    M

    • Hey Mike, the 404 issue doesn’t look like caused by the meta box you’ve added. I’d love to check your code to see what I can help. Shoot me an email to yoren [at] 1fix.io.

Submit a comment

Your email address will not be published. Required fields are marked *