Tell us what you are trying to do?
We can't get toolset_get_related_post to return a related post ID.
Is there any documentation that you are following?
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post
Is there a similar example that we can see?
function get_results_page ( $data ) {
$args = array(
'post_type' => 'custom-post',
'post_status' => 'publish',
'meta_key'=> 'wpcf-api-alias',
'meta_value'=> $data->get_params('id'),
);
$query = new WP_Query( $args );
$Post = $query->posts[0];
$EmailPost = toolset_get_related_post( $Post, 'custom-post-results-email' );
return array(
'post'=>$Post,
'post_meta'=>get_post_meta( $Post->ID ),
'email_post'=>$EmailPost,
);
}
//"email_post": 0
What is the link to your site?
It's under local development.
My issue is resolved now. Thank you!