The issue here is that the user wants to filter the current view by 2 post relationships from different post types.
Solution:
This can be resolved by using the code below.
//Return only posts from the current author when listing posts of type company:
function tssupp_filter_query( $query_args, $view_settings, $view_id ) {
if($view_id == 123){
$query_args['toolset_relationships'] = array(
array(
'role' => 'child',
'related_to' => 63,
'relationship' => 'leverancier-categorie-leverancier'
),
array(
'role' => 'child',
'related_to' => 51,
'relationship' => 'vestiging-leverancier'
)
);
}
return $query_args;
}
add_filter( 'wpv_filter_query', 'tssupp_filter_query', 99, 3 );
This can be added to the Toolset Custom code section in Toolset->Settings->Custom Code. Change the 123 to the ID of your view and adjust the relationship slug and related_to to the correct ID of the posts.