Tell us what you are trying to do?
I am trying to find the custom field for CPT parent post relationship. I am using an import plugin and every time I import my posts, it deletes the relationship. I am able to change the settings of this import plugin to disable importing the custom field for the parent post relationship but I don't know what the custom field is.
I tried wpcf-pr-belongs and wpcf_pr_belongs and both didn't work. It still cancels off the relationship.
Hello. Thank you for contacting the Toolset support.
Well - we have detailed Doc available to import your content using CSV.
The postmeta key that holds the parent field ID is: _wpcf_belongs_{parent-posttype-slug}_id
Where:
- Replace {parent-posttype-slug} with your original parent post type slug.
Is there another custom field? Something more generic? Because I will be telling the plugin to not import that custom field for all the posts. If we use _wpcf_belongs_{parent-posttype-slug}_id, it will only work for 1 post but not for the rest.
Well - post relationship will be created either by using Types (GUI) or using custom PHP code.
As I already explained you:
The postmeta key that holds the parent field ID is: _wpcf_belongs_{parent-posttype-slug}_id
Where:
- Replace {parent-posttype-slug} with your original parent post type slug.
If you want to import Types Post Relations, When using Types posts relationships, the parent of a given type is stored as:
_wpcf_belongs_{parent-posttype-slug}_id
Let’s assume that we are displaying a Car post type (child post type) that has a Maker (parent post type) as a parent post type. Each Car will store its Maker id in the field _wpcf_belongs_maker_id in post meta table.
Parent Post ID cannot be “guessed” by the system. You first need to create your parent post and get its ID. Then you can use that ID to import child posts.