Passer la navigation

[Résolu] Can you filter by parent’s custom field in Views?

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 4 années et 9 mois. 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

Fuseau horaire du supporter : Africa/Casablanca (GMT+01:00)

Ce sujet contient 4 réponses, a 3 voix.

Dernière mise à jour par StanleyT8485 Il y a 4 années et 9 mois.

Assisté par: Jamal.

Auteur
Publications
#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

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+01: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!