Jonathan Gwyer
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Auto Generate Child Post Title based on Parent Title
Started by: Jonathan Gwyer
in: Toolset Professional Support
Problem: I have a one-to-many post relationship set up in Types. When I create a child post in wp-admin, I would like to automatically set the child post title based on the parent post's title, using save_post. Solution: Use the post relationships API toolset_get_related_post to retrieve the parent post ID during the save_post hook when saving a child post. Then use WordPress API wp_update_post to set the child post title automatically. $parent_id = toolset_get_related_post( $post_id, 'relationship-slug' ); Relevant Documentation: |
|
2 | 5 | 5 years ago |