How to create a one to many relationship in two different custom post types

WP_Post has a property post_parent by default. Usually this is used for parent-child relationship on hierarchical post types, such as pages, but nothing actually prevents you from linking two different post type posts together with it.

You’ll just need a metabox on your travel report CPT, which allows you to select an author CPT post (id) as the parent. This select should have post_parent as its name so that the value gets saved to the right property.

tech