[Plugin: Posts 2 Posts] Add a connected post to title when saving
-
What I would like to achieve:
Add custom post type ‘Game’: Testing Game
Connect to custom post type ‘Team’: A TeamWhen saving/publishing: change title of the ‘Game’ to: Testing Game – A Team
I’m using this code in functions.php
function change_title($data, $postarr) { if ($data['post_type'] == 'games') { $data['post_title'] = 'new title'; return $data; } else { return $data;} } add_filter('wp_insert_post_data','change_title',99,2);
I looked through the code, but can’t find how the connection is saved when publishing the post (but i’m not very php savvy…).
Any hints on how I could achieve this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Posts 2 Posts] Add a connected post to title when saving’ is closed to new replies.