Tell us what you are trying to do?
Get post meta of created inermediary post in wp-admin
Is there any documentation that you are following?
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_association_created
Is there a similar example that we can see?
add_action( 'toolset_association_created', 'handle_association_created', 10, 5 );
function handle_association_created( $association_slug, $parent_id, $child_id, $intermediary_id, $association_id ) {
$my_taxonomy = 'fight';
$fightnumber = types_render_field( 'fight-number', array( 'post_id'=>$intermediary_id) );
$cat_id = get_term_by( 'slug', $fightnumber, $my_taxonomy );
$cat_id = $cat_id->term_id;
wp_set_object_terms($intermediary_id, $cat_id, $my_taxonomy);
}
This works
$fightnumber = types_render_field( 'fight-number', array( 'post_id'=>2032) );
This does not work
$fightnumber = types_render_field( 'fight-number', array( 'post_id'=>$intermediary_id) );
What am I doing wrong?