Skip Navigation

[Resolved] Custom dropdown for relationship field based on user role

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

Problem:

Customize parent selector dropdown of post form by user roles.

Solution:

There isn't such kind of built-in feature within Toolset Forms, you might consider custom codes to setup a HTML select dropdown to replace it.

Relevant Documentation:

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

Our next available supporter will start replying to tickets in about 1.38 hours from now. 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 2 replies, has 2 voices.

Last updated by himanshuS 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1882033

Tell us what you are trying to do?
I have a project submission CPT that is linked in O2M relationship with project prompt CPT.
An expert user role can create project prompts and a professional role can create project prompts.
A user can create a project submission using a project prompt (through urlparam) but can also go directly to the create project submission form and select a project prompt.
For the later, I want the drop down to select project prompt (a relationship field) to only show project prompts from expert user type and current user. I can get the current user with the radio button that allows me to only select posts from current author. But how can I create a dropdown that shows prompts from both experts and current user?

#1882487

Hello,

I assume you are going to display project posts(which author user role is "experts") + post's author is current user as options of parent "project" selector.
If it is, there isn't such kind of built-in feature within Toolset Forms, you might consider custom codes to setup a HTML select dropdown to replace it.

And you can add a feature request for it, our developers will evaluate it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

#1887571

Thanks.