Skip Navigation

[Geschlossen] filter taxonomy based on custom field value and exclude if ticked

This support ticket is created vor 3 Jahre, 4 Monate. 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 3 Antworten, has 2 Stimmen.

Last updated by Minesh vor 3 Jahre, 3 Monate.

Assisted by: Minesh.

Author
Artikel
#1884633

Hey guys, I have a number of taxonomy terms that I would like to filter out of the results IF a custom field value is present.

I have a custom post that is 'published' therefore making the taxonomy term publicly visible, however, I have a custom field called "private published" where only users with a code can view the post.

I would like to exclude taxonomy terms being visible that meet the custom field value of '1'

This is my starting point: https://toolset.com/forums/topic/exclude-some-taxonomy-terms-from-filter-search/#post-204079

this excludes a fixed list, but how would I check for the presence of a value on the Articles CPT and then grab the items and exclude it from what's returned in the taxonomy loop.

taxonomy: article-tag
Custom field on the "Articles" cpt to check against: wpcf-private-listed = 1

IF wpcf-private-listed = 1 dont show taxonomy terms in view output.

#1885143

Minesh
Supporter

Languages: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

As I understand, you created a post type that holds the checkboxes fields where user can select those checkboxes to make the terms should be excluded.

So, for example: You have post type "Students": with taxonomy having terms 1 to 5.
- Post 1 (term 1, term 2 selected)
- Post 2 (term 2 selected)
- Post 3 (term 1 selected)
- Post 4 (term 2 selected)
- Post 5 (term 2 selected)

So, with all above 5 posts for student post type, term 1 and term 2 selected, so you want that term 1 and term 2 posts should not be displayed with the view? Only posts belongs to term 3, term 4 and term 5 should be displayed as those terms are not selected within the available posts?

#1894431

The example you have provided is not quite what I had in mind... I'll expalin further

I have a post that is 'published', however the post is not public - its restricted from being viewed unless someone enters a specific code in a URL parameter.

I also have a view that filteres out all private public posts using a custom checkbox field on each of them 'private post' so they are not searchable.

However, if the 'private published' post has a taxonomy term that is not used by any other public posts then that taxonomy term is visible.

Now this isnt a major issue, but it would be good if I could apply the same logic I do to the main View, on the Taxonomy terms view.

Thanks

#1894521

Minesh
Supporter

Languages: Englisch (English )

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

If you can share problem URL and access details and setup a test example and tell me at what point what posts/taxonomy should be visible, so once I can review your current setup I will be in better situation that will help me to guide you in the right direction.

Please share all required information with test example.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

Das Thema „[Geschlossen] filter taxonomy based on custom field value and exclude if ticked“ ist für neue Antworten geschlossen.