Skip Navigation

[Resolved] I want to only display the parent items of the current user in a select box

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

Problem:
How to display the only posts created by current author or logged in user with CRED form's field that display the parent select box

Solution:
You should use the CRED field attribute author="$current" that will help you to display only current user created parent posts.

You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/i-want-to-only-display-the-parent-items-of-the-current-user-in-a-select-box-4/#post-747717

Relevant Documentation:

This support ticket is created 6 years, 7 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 3 replies, has 3 voices.

Last updated by razvanP 6 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#745962

Hi Guys,

Very excited to play with the RC version.
Could you point me in the right direction on how to only display the parent items of the current user in a select box.
I tried to add a relationship post field, but I still get the parents from all users. How can I restrict only to the parent post on the logged in user?

The full details of what I'm trying to achieve are in this post https://toolset.com/forums/topic/i-want-to-only-display-the-parent-items-of-the-current-user-in-a-select-box-3/

Thanks a lot!
Razvan

#746543

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Could you please tell me what shortcode you are using inside the CRED form to display the parent?

#747717

Juan
Supporter

Timezone: Europe/Madrid (GMT+01:00)

Hi Razvan

Thanks for the feedback. This is Juan, Toolset team leader.

In this release candidate for CRED we added support for limiting the options that appear in selectors for related posts, but unfortunately this does not mean that a proper GUI for it was added. In other words: you need to adjust the shortcode manually.

From what I read in the ticket you link, you have a

cred_field

shortcode that is displaying the selector to set the related post in a post form, right? To limit the options that this selector will offer to posts created by the current visitor, just add the following attribute to this

cred_field

shortcode:

author="$current"

.

That should be enough.

Please give it a try and let us know whether this helped.

Regards.

#774206

It works.
Thanks a lot guys!!!

Razvan