Skip Navigation

[Resolved] Restricting taxonomy terms on cred form

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

Problem:
Can I hide certain Terms of a taxonomy in CRED Fields, given Terms assigned to another Post?

Solution:
No.
And even with Custom code this is a not-reccommendable approach as very expensive Queries will have to run on each CRED Form load.

A better Idea would be to use a Parent Post instead of Taxonomies.
But of course that's not the same as categorizing content.

You could restrict the "parent Post Picker" with posts that only the current user authored.
And if you as a admin first "admit" the parent post by publishing those, it could be used as a sort of workaround to the goal.
This below is how you would then restrict the Parent Post Picker to only display posts the current user authored:
https://toolset.com/forums/topic/i-want-to-only-display-the-parent-items-of-the-current-user-in-a-select-box-2/#post-351830

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

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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by geophray 7 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#400462

I am trying to figure out if there is a way to disable or hide taxonomies on a cred post form based on the taxonomy terms enabled on a different custom post type by the same author.

For example, I have two cpt's "Instructor" and "Event"". A user can only create a single post of type "Instructor", but is not limited in the number of "Event" posts they can create. Both post types use a taxonomy "Curriculum".

In the "Instructor" posts, the "Curriculum" taxonomy is for admin use only to mark which terms the user/author is approve to offer, and is not available to be updated anywhere on the front end. On the "Event" posts, "Curriculum" is used to identify which curriculum will be taught at that particular event. When a post author creates/edits an "Event" post, I'd like for the "Curriculum" terms marked on their "Instructor" post to be the only available options, as those are the only ones they are approved to offer.

I've searched through the forums, and haven't really found anything just like this use case, although I'm wondering if something along the lines of this post would be a good direction to move:

https://toolset.com/forums/topic/hide-empty-terms-form-cred_field-taxonomy-select/

I don't know much about API's, but am wanting to learn. If you have any other suggestions of something that might work from the default functionality of the toolset plugins, I would greatly appreciate your input.

#400585

That's rather an expensive query you plan here.

The theory:

1. Get the Posts the current User has authored
2. Get their assigned terms of your taxonomy
3. Display only those Terms in the Current edited / created posts.

This is theoretically possible with Custom PHP (not even using CRED API but rather the WordPress API)

But, I can not provide this code - as it's completely unsupported by CRED or Toolset at the moment (and there are no such plans to add this sort of settings).

We can not provide Custom Code that is above the features of Toolset:
https://toolset.com/toolset-support-policy/

It seems -unfortunately- that for now you need custom programming work which is beyond the scope of our support.

At this point I would suggest you consider contacting one of our certified partners from this link:
https://toolset.com/consultant/

You will get the custom assistance you need to get on with your project.

A better Idea would be to use a Parent Post instead of Taxonomies.
But of course that's not the same as categorizing content.

Though, here you could restrict the "parent Post Picker" with posts that only the current user authored.
And if you as a admin first "admit" the parent post by publishing those, it could be used as a sort of workaround to your current situation
This below is how you would then restrict the Parent Post Picker to only display posts the current user authored:
https://toolset.com/forums/topic/i-want-to-only-display-the-parent-items-of-the-current-user-in-a-select-box-2/#post-351830

#401007

Thank you for the detailed reply Beda. I knew it was a longshot... 🙂

I'll maybe revisit this from another angle later. I appreciate your thoughtful response.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.