Skip Navigation

[Resolved] Can you filter by parent’s custom field in Views?

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user would like to filter a view by a parent post custom field.

Solution:
This is not possible yet with Toolset. We can only filter by the queried posts fields, not related posts field.

But, it is worth to mention some of our APIs that might help achieve this goal to some extent:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
- https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/

This support ticket is created 4 years, 2 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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 4 replies, has 3 voices.

Last updated by StanleyT8485 4 years, 2 months ago.

Assisted by: Jamal.

Author
Posts
#1813263

Tell us what you are trying to do?
I want to filter by the parent's custom field in Views. The parent is based on Types relationship.

Is this possible?

#1813379

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Unfortunately it isn't possible, no. Filtering by fields of related posts is on our to-do list, but I don't know when we will get to it, it is not scheduled in the next couple of dev cycles, so it is a minimum of some months away.

#1813405

I have a nested View which has custom fields from both Parent and Child posts. I was hoping to create a filter that can filter based on fields from both the Parent and Child post.

Hopefully when it is built, it can accomplish the above 🙂

#1813725

Thank you Stanley for your feedback. Toolset will always seek to get better and better.

If you are comfortable with PHP coding, it is worth to mention some of our APIs that might help you achieve your goal to some extent:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
- https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/

All the best for your project.

#1814505

My issue is resolved now. Thank you!