Skip Navigation

[Closed] Filter content / based on comparison user-fields – post fields

This support ticket is created 8 years 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
- 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 12 replies, has 2 voices.

Last updated by Luo Yang 7 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#382494

Hi there,

We want to build a page with a view of filtered content for logged in users:
- The users selected a option (A / B / C) in their registration cred-form (options created by wp-types user-fields).
- The posts have a option (A / B / C) created by wp-types post-fields.

We want the loop which will be shown in the users personal page to be filtered by this option.
This page is only accessible after login.

The thing we need to build is a filter based on:

Logged in user:

wp-types user-fields: option 1 (A / B / C)
compare to
wp-types post-fields: option 1 (A / B / C)

AND

wp-types user-fields: option 2 (A / B / C)
compare to
wp-types post-fields: option 2 (A / B / C)

The posts with a hit are shown in this loop.

I hope this is clear enough and somebody can help me out te set this up.
Thanks on behalf!

Paul

#384838

Dear Paul,

Q1) This page is only accessible after login.
I suggest you use Access plugin to limit the access to the specific page, see our document:
Limiting read access to specific content
https://toolset.com/documentation/user-guides/limiting-read-access-specific-content/

Q2) We want the loop which will be shown in the users personal page to be filtered by this option.
You can use Views filter hook "wpv_filter_query" to add your custom filters, see similar thread:
https://toolset.com/forums/topic/create-a-query-filter-in-a-view-to-filter-on-wp-favorite-posts/

More help:
wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/

Hope it help

#391571

Hi Luoy,

Thanks for your reply, i've been reading these pages and hope you can help me a bit more.

Q1: The page is already locked by Acces so we got this covered.

Q2:
- We have a Cred form for registration where the 'wp-types user-fields' are filled in and stored in the users profile page.
- We have a Cred form for creating the post with the 'wp-types post-fields'.

This is our actual case. We want to filter to a wp-view, based on comparing a:

wp-types user-field: option 1 (A / B / C) compare to wp-types post-field: option 1 (A / B / C)
AND
wp-types user-field: option 2 (A / B / C) compare to wp-types post-field: option 2 (A / B / C)

Can you help me out to create this piece of code because i can't get my head around it...
That would be really great.

Thanks,

Paul

#391950

Dear Paul,

About the question Q2, as you can see, it needs custom PHP codes, according to our new support police, we can not provide the custom codes support:
https://toolset.com/toolset-support-policy/

But if you still need assistance for it, please duplicate same problem in a test site, and fill below private detail box with login details and ftp access, also point out the problem page URL, view URL and which one is the specific user field, which one is the specific custom post field. I can try setup a demo for you, thanks

#394445

Same problem as your another thread, the credentials for "Authentication Required" window does not work, please check it and update this thread when it is ready, thanks

#400271

Hi Luoy,

Our server is up and running again so you can enter...
Thanks,

Paul

#400709

Dear Paul,

I assume it is same test site of your another thread:
https://toolset.com/forums/topic/forms-for-creating-and-editing-child-content/

I see the error: 502 Bad Gateway
Please check it. thanks

#400749

Hi Luoy,

Nginx gave some issues.
You can enter if you like.

Thanks.

Paul

#400797

Same as your another thread, I need the sftp access. please check it
https://toolset.com/forums/topic/forms-for-creating-and-editing-child-content/#post-394215

#403668

Hi Luoy,

I think you can enter now, you fixed all other issues 🙂

Thanks
Paul

#404048

Could you point out the problem page URL, view URL and which one is the specific user field, which one is the specific custom post field. I need test it in your website, thanks

#404050

Hi Louy,

I will create some content under your login (account), after that i will explain what we want to do.
It will take a day or two.

Thanks for your time.
Paul

#404110

OK, please update this thread when your test site is ready, thanks

The topic ‘[Closed] Filter content / based on comparison user-fields – post fields’ is closed to new replies.