Hi there,
I have set up a custom post type (Channels) and created custom fields including repeatable field groups (RFG slug: length-groups ) too. I am using the following code to access the RFG.
$length_post_ids = toolset_get_related_posts(
$channel, // the parent post POST obj
'length-groups', // the RFG slug
'parent', // the post role in this relationship is 'parent'
1000000, // the maximum number of results
0, // the offset
array(), // additional query arguments
'post_id', // return format
'child' // role to return
);
Hello. Thank you for contacting the Toolset support.
With the following line of code:
$channel, // the parent post POST obj
Can you please make sure you pass the channel ID.
This is your original code:
$length_post_ids = toolset_get_related_posts(
$channel->ID, // the parent post POST obj
'length-groups', // the RFG slug
'parent', // the post role in this relationship is 'parent'
1000000, // the maximum number of results
0, // the offset
array(), // additional query arguments
'post_id', // return format
'child' // role to return
);