Skip Navigation

[Resolved] restrict the selectable options on post relationship field

This support ticket is created 4 years, 1 month 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
- 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 1 reply, has 2 voices.

Last updated by Minesh 4 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1525747

I have a form with a post relationship field. I want to restrict the selectable options to those related to the author.

For example, I have a post form that let’s the user submit a repair ticket for a property.

The form has a post relationship field linking it to a property, and I want the post relationship form to restrict the options as follows:
If you are a renter, you can only choose the property you are currently renting.
If you are a property owner, you can only choose from among the properties you own.

I've tried looking through the documentation but couldn’t make any progress.

Is it possible to do something like this? If so, could you point me in the right direction?

Link to the site: hidden link

#1526857

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

You can use the attribute author="$current" so that the parent dropdown only includes parent posts whose author is the current user.

For example:

[cred_field field='@client-estimate.parent' author="$current" class='form-control' output='bootstrap'  select_text='--- not set ---']

More info:
=> https://toolset.com/documentation/user-guides/front-end-forms/cred-shortcodes/#cred_field

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