Skip Navigation

[Resolved] View Query Filter with two relationships

This support ticket is created 3 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 3 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1767603

Hi! I need help.



I have 3 CPTs

01. Interaction

02. Event

03. Profile



I need to check if an “interaction” have relationship with an “event” and a “profile” (in same time).



I created a view to get interactions. I set a query filter to relationship with specific event (by attribute). When i try to add a new filter (relationship with specific profile), the option don’t load to insert.



I think in view is not possible to add query filter two times by relationship. Confirm? So, how can i do this?

#1768019

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Using View's GUI, yes, you can add only one post-relationship filter at the moment.

To filter your view by multiple post-relationships, you will require to use the view's filter hook: wpv_filter_query
=> https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

Please check the following example about how you can add multiple post-relationship filter:
=> https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/how-to-migrate-your-site-to-new-post-relationships/#advanced-example

Please let me know if you will require further assistance.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.