/** * This filter fills in the post name for our custom post type */ add_filter( 'wp_insert_post_data' , 'gnt_modify_post_title' , '99', 2 ); function gnt_modify_post_title($data) { //only run for our post type if ($data['post_type'] == 'hbl_product') { //get title from field $pod = pods( 'hbl_product', get_the_id() ); //get the value for the relationship field $fund_name = $pod->field( 'selected_fund.fund_name', get_the_id() ); //create a post title $data['post_title'] = "$fund_name"; } return $data; }