Skip Navigation

[Resolved] Filter post relationship fields to show only parent post created by log in user

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

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 2 replies, has 2 voices.

Last updated by nabils 5 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1399459

Tell us what you are trying to do?
Hi,
Have to post types tenant and rental where tenant is the parent of rental. When the user create new rental there is a relationship field to select the parent. For now it shows all the tenant event the tenant that are not created by the current logged in user. How can I filter the relationship field to show only tenant created by current logged in user?

#1399603

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

With Toolset form when you add the parent field , you can use the attribute author="$current" so that the select dropdown only includes parent posts authored by the current user for your parent dropdown select.

For example - I've added the attribute as given under with my parent field:

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

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

#1399715

My issue is resolved now. Thank you!