Skip Navigation

[Resolved] field value in the search form

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

Problem:
The user is trying to filter posts for custom post types using a view by a user field.

Solution:
ts not possible as there is no direct link between the post types and user fields. And you can build a custom search for only post type views. You can not build a custom search for user and taxonomy views.

However, the case is different here, in this case, you want to filter post type view using a user field, that's not possible natively.

You can check an example on this article - how you can create a custom search for the user.

Relevant Documentation:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

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

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 2 replies, has 2 voices.

Last updated by FuChan 4 years, 7 months ago.

Assisted by: Jamal.

Author
Posts
#1563661

I create a CPT with some custom fields and set up a custom field (slug name: area) in the User Fields.
In the Views, I can use [types usermeta="area"][/types] to let it display with other fields of the CPT.

How can I use the field value of "area" in the search form? I want it to be a filter, and retrieve the custom posts by it.
Thanks

#1564027

Hello and thank you for contacting the Toolset support.

If I understood well you are trying to filter posts for custom post types using a view by a user field, right? If yes:

Basically, its not possible as there is no directly link between the post types and user. And you can build custom search for only post type views. You can not build custom search for user and taxonomy views.

However, the case is different here, in this case you want to filter post type view using a user field, thats not possible natively.

You can check an example on this article - how you can create custom search for user.
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

If I did not understand your request well, please elaborate more on it.

#1565423

My issue is resolved now. Thank you!