Hello,
I have old relationship system (legacy).
Here are the 3 post types :
member, production and production-member (I have X members and Y productions, each members can have many productions, and each productions can have many members).
(I have other same kind of relationships like : member, program and program-member and member, event, event-member)
First of all, I try to use this code :
$posts = toolset_get_related_posts(
$post,
['member', 'production-member'],
'parent'
);
Instead of returning only 'production-member' posts linked to member, the function returns a list of 'production-member', 'program-member' and 'event-member'... strange
Anyway, I filter the results by post_type in a loop and then I try to get the production of the production-member :
// $posts is an array like : [0 => 3096, 1 => 3122, ...]
foreach ($posts as $row)
{
$tmp_post = get_post($row);
if ($tmp_post->post_type == 'production-member')
{
$productions_posts = toolset_get_related_posts(
$tmp_post,
['production-member', 'production'],
'parent' // tried with child too
);
}
}
When I dump $productions_posts, always have an empty array.
Any help much appreciated.
Thanks
WordPress 4.9.8
All Toolset plugins are up to date